The question I have is for something I've been scratching my head about recently --
In my interceptor, I have code that parses and handles certain errors, and will act in certain ways depending on an error's status code, etc (I didn't include this code due to it not really serving any purpose to this question, but if someone has a good reason as to why I should include it, I absolutely can.
I am trying to figure out how to handle net :: ERR_TIMED_OUT (Using google chrome / opera) in my interceptor. I've tracked it down to a point where I can tell that a request IS being built and being 'handled', but after that, the request and response are both gone. My initial thought here is that there is an XMLHttpRequest error somewhere and it is being suppressed in some way and the response is being thrown out.
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
const intercepted = this.setHeaders(req);
return this.SetPendingRequests(next.handle(intercepted))
.pipe(catchError((err): Observable<HttpEvent<any>> => {
return this.ParseErrorResponse(err);
}));
}
I've tried adding finalize(() => {}) to it as well and that works fine in every case except for this one, where ERR_TIMED_OUT just basically seems to decide that all things must stop for it.
I've also tried hooking into XMLHttpRequest directly and angular didn't take that too kindly - as I feel the root of the problem could stem from that itself.
All google/stackoverflow searches pretty much point to it being a local issue, but I feel as if there should be some way to handle it in my code so if a user were to run into this error while using my app, I'd be able to handle that appropriately. Basically, I just want any request for ERR_TIMED_OUT (which oddly enough, other browser base errors return an error of 'Unknown Error' type -- this is the only odd outlier I've found that just simply stops everything. I'm looking to see if anyone else has run into this issue / would be willing to help aid me in sniffing it out.
Appreciate any help on the matter and thanks in advance,