stop response in interceptors
See original GitHub issueWe use global response interceptor to do authentication:
when the server returns 401, call vue-router to go to the Login route. After this point, the response should not be processed by any other interceptors or by user code any more.
The problem is that, if I understand correctly according to the code, the response will be sent down though the interceptor chain and to user code after all.
Can we have something like response.stop
method to prevent it from further processing?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:3
- Comments:9 (1 by maintainers)
Top Results From Across the Web
How to cancel current request in interceptor - Angular 4
If you wanna cancel requests after a certain timeout you can use rxjs timeout operator in intercepter, and it will work for every...
Read more >Interceptors | Axios Docs
You can intercept requests or responses before they are handled by then or catch . ... If you need to remove an interceptor...
Read more >Top 10 ways to use Interceptors in Angular - Medium
My ten favorite ways to use the interceptor in Angular. With examples of error handling, profiling, caching and more this list will inspire...
Read more >Angular: Handle HTTP Errors using Interceptors
An error interceptor is a special type of interceptor which is used for handling errors that arise while making an HTTP request. The...
Read more >Angular Interceptors to Manage HTTP Requests
Although interceptors can modify requests and responses, ... order should be used to avoid surprises when expecting a detailed response 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
@steffans Hello, I’m sorry but I still don’t know how to stop response in interceptors.
When response is an error from server, how to handle the error globally and stop the Promise.resolve or Promise.reject?
I don’t want to handle the error like 40* specifically in every component.
@listen-lavender In your top level component ( the first argument of
router.start
call), define: