[Vuejs]-Check HTTP status code in the Axios promise catch block VueJs

1đź‘Ť

Maybe your API endpoint brakes CORS policy, you can’t read status of such error then (despite the fact that it is visible in Networks tab in dev tools).

You can install a browser extension like “CORS everywhere” to test if it works then, but any call to API blocked by CORS will show a warning/error in the browser’s console by default.

👤Deykun

0đź‘Ť

Probably because err.response.status is a string and you are comparing to number

👤Nonik

Leave a comment