Can't throw error (reject promise) in response interceptor
See original GitHub issueChrome will throw ‘Uncaught (in promise)’ if I return reject in response interceptor.`
when
function takes 3 args: value, fulfilled, rejected
, but is called with only 2, no rejected callback here:
https://github.com/vuejs/vue-resource/blob/b9c195daca50188f9338d0900654e75fb6eed483/src/http/client/index.js#L40-L46
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
Interceptors and unhandled promise rejection #1939 - GitHub
I am using a interceptor to handle errors globally but I am still getting "Unhandled promise rejection" errors on the console for every ......
Read more >Handling a Promise reject in axios interceptor - Stack Overflow
Try throw error; instead of return Promise.reject(error); in the interceptor. – butchyyyy. Jul 9, 2019 at 14:48.
Read more >How to handle unhandledrejection errors using axios
Axios is a great library, but unhandled promise rejections can be a ... The way to do this is to re-throw the original...
Read more >Setting up Axios Interceptors for all HTTP calls in an application
Automatically intercept all the requests and responses so you don't ... the error() function will kick in and throw an error rejecting the ......
Read more >Axios interceptors in react, error 401 - Laracasts
I got my admin private route on the app.js, laravel as a backend. Got an axios interceptor to catch error 401, 403 and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
So do I, I have tried a lot to do a catch all in the interception but no luck at all. Does anyone have any clue?
Cheers
I just created a pull request to let Promise rejections bubble up the chain, this makes it possible to catch the error using the standard
.catch
method. Please support the pull request to add this feature and make vue-resource’s error handling easier.