Laravel 5: Handle exceptions when request wants JSON

前端 未结 8 1711
野的像风
野的像风 2021-01-30 05:30

I\'m doing file uploads via AJAX on Laravel 5. I\'ve got pretty much everything working except one thing.

When I try to upload a file that is too big (Bigger than

8条回答
  •  情深已故
    2021-01-30 06:06

    you can easily catch err.response like this:

    axios.post().then().catch(function(err){
    
    
     console.log(err.response);  //is what you want
    
    };
    

提交回复
热议问题