Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

146
Views
Zone.js possibly blocking HttpErrorResponse from being received by HttpInterceptor

I'm having issues getting my HttpInterceptor to work on my application. This is my code:

intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
return next.handle(req)
  .pipe(
    catchError((error: HttpErrorResponse) => {
        if (error instanceof HttpErrorResponse) {
          console.log(error);
          let toast: Toast = {
            header: "",
            body: "",
            details: "",
            pinned: false,
            showDetails: false,
            type: ToastTypes.DANGER,
          };
          switch (error.status) {
            ...
          }
       return throwError(error);
    }))
  )
}

I've tried to use tap() too in my pipe but whenever an error occurs, I only get this on my console:

POST http://localhost:4200/fhir/search 500 (Internal Server Error)
scheduleTask    @   zone-evergreen.js:2845
scheduleTask    @   zone-evergreen.js:385
onScheduleTask  @   zone-evergreen.js:272
scheduleTask    @   zone-evergreen.js:378
scheduleTask    @   zone-evergreen.js:210
scheduleMacroTask   @   zone-evergreen.js:233
scheduleMacroTaskWithCurrentZone    @   zone-evergreen.js:1134
(anonymous) @   zone-evergreen.js:2878
proto.<computed>    @   zone-evergreen.js:1449
...

Additionally, even if I try to handle errors inside subscribe() blocks, the same behaviour happens and my code is ignored.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!