Angular, Tutorial, Coding, JavaScript, Technology.
@Injectable() export class ErrorInterceptor implements HttpInterceptor { intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> { return next.handle(req).pipe( catchError((error: HttpErrorResponse) => { // Handle the error here return throwError(error); }) ); } } By