[Vuejs]-Passing an error to a component

-1👍

The catch() block only gets called if the Laravel backend throws an error. So if you are returning a normal status code of 2xx then axios always calls the .then() part. In that case, you have to resolve the error message yourself.

Try something like this in your backend route (it will return an error):

return response()->toJson([
    'message' => 'error message',
], 500);

And see if this responds with an actual error in you vuejs application.

Leave a comment