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

254
Views
Errorhandler interceptor- when error code is 400, display a modal with button

I need to check with the interceptor all the requests that get an error code of 400, if they have the error code then a modal should be displayed with okay button I have gotten the if else condition part working, how do I integrate a modal or a pop up in it integrate a modal like this https://stackblitz.com/run?file=src%2Fmain.ts code for interceptor file

import {Injectable, Inject} from '@angular/core';
import {HttpErrorResponse, HttpEvent, HttpHandler, HttpInterceptor, HttpRequest} from '@angular/common/http';
import {Observable, throwError} from 'rxjs';
import {catchError, concatMap} from 'rxjs/operators';


@Injectable()
export class ErrorCatchingInterceptor implements HttpInterceptor {
  constructor() {
  }
  intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
      console.log('in console');

      return next.handle(request)
    .pipe(catchError((err: any) => {
        if (err instanceof HttpErrorResponse) {
            if (err.status === 400) {
                console.log('Error');
            }
        }

      return new Observable<HttpEvent<any>>();
    }));
  }
}
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!