Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

261
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda