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

260
Views
Interceptor de manejador de errores: cuando el código de error es 400, muestra un modal con botón

Necesito verificar con el interceptor todas las solicitudes que obtienen un código de error de 400, si tienen el código de error, entonces se debe mostrar un modal con el botón Aceptar. He conseguido que funcione la parte de la condición if else, ¿cómo integro un modal o una ventana emergente integra un código modal como este https://stackblitz.com/run?file=src%2Fmain.ts para el archivo interceptor

 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!