Closed joshikeerti closed 7 years ago
How about catch()
operator?
httpInterceptorService.response().addInterceptor(res => res.catch(e => {
console.log('Caught http error:' + e);
return Observable.empty(); // Recover from error
}));
I'm going to close this assuming my example helped you.
Is there a way to intercept errors? Currently httpInterceptor.request() and httpInterceptor.response() intercept the request and response, but if we need to intercept errors, is there a method that can help do this?