question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't throw error (reject promise) in response interceptor

See original GitHub issue

Chrome 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:closed
  • Created 7 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
tiagomatoswebcommented, Mar 14, 2017

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

0reactions
jarvelovcommented, Jun 7, 2017

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 .catchmethod. Please support the pull request to add this feature and make vue-resource’s error handling easier.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found