You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
The order is kind of illogical: global interceptor -> error handler -> local interceptor;
There is no way to let know from the error handler that interceptors should not handle that error anymore.
Now the use-case: I want to make user aware of every failed request. But:
Some of them I'll handle in my controllers where I call the action. Let's say show very nice error message, or implement the fall-back logic;
Some of them are resource specific. Like if I have User resource and it returns me 404 not found, I always want to redirect somewhere;
And finally all other errors. I want no silent failures to happen and I write a global interceptor which will handle all error responses (if they are not handled yet) and show growl-style notification with HTTP code and error message from server.
Currently it's only possible to talk from error handler to local interceptor by setting some response._handled = true (not really nice), but global interceptor is always executed first and thus completely out of control.
The solution could be:
Add a an order attribute to interceptors. Error handler can have some default value and interceptors get order assigned relative to that;
Some way of preventing interceptors of being called from the error handler.