onResponseError not running
code:
I can see neither one of these log when I get a 401 error. (for now I'm manually deleting the auth tokens and make a request to expect the error)
I expect to see in the console
'
onResponseError' : something
based on this line
3 Replies
My end goal is to navigate the user back to /login when this happens
full code:
https://github.com/nuxt/nuxt/issues/20090 related.
I think I had similar issue, looks like onResponseError is meant for network-level errors. It wont be triggered for 401, 404, 500
GitHub
onResponseError({ request, options, response }) is not triggered ev...
Environment Operating System: Darwin Node Version: v16.17.1 Nuxt Version: 3.3.3 Nitro Version: 2.3.2 Package Manager: [email protected] Builder: vite User Config: app, imports, css, modules, pinia, vite...
I gave up on $fetch and useFetch and just use a regular fetch. I might come back to it when I get some patience