-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Can't throw error (reject promise) in response interceptor #377
Comments
I'm having this same problem. When using interceptors is there a way to get away with this |
Currently it's not implemented that a interceptor can reject a Promise, what would you expect to happen after you returned a rejected Promise? |
In fact, I just want to silence the errors in console. |
@victorwpbastos Just catch the failed promise yourself and return the original response.
|
@steffans It would be great to feed the error to raven-js Currently using window.onunhandledrejection but it does not have yet browser support. Besides, I also don't like a 'catch all' solution that onunhandledrejection provides. |
I still have no idea how could i perform Error Handling in interceptors... any hacks? |
So do I, I have tried a lot to do a catch all in the interception but no luck at all. 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 |
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
The text was updated successfully, but these errors were encountered: