@Injectable()
export class HttpRequestInterceptor implements HttpInterceptor {
- constructor(private notificationService: NotificationService) {}
+ constructor(private notificationService: NotificationService) { }
intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
console.log('Interceptor Invoked' + request.url);
- return next.handle(request).pipe(
- catchError((error: HttpErrorResponse) => {
- console.error("Error from error interceptor", error);
+ if (!request.url.includes("info-jobs")) {
+ return next.handle(request).pipe(
+ catchError((error: HttpErrorResponse) => {
+ console.error("Error from error interceptor", error);
- // show dialog for error message
- this.notificationService.error(error.message);
- return throwError(error);
- })
- ) as Observable<HttpEvent<any>>;
+ // show dialog for error message
+ this.notificationService.error(error.message);
+ return throwError(error);
+ })
+ ) as Observable<HttpEvent<any>>;
+ } else {
+ return next.handle(request).pipe(
+ catchError((error: HttpErrorResponse) => {
+ console.error("Error from error interceptor", error);
+ return throwError(error);
+ })
+ ) as Observable<HttpEvent<any>>;
+ }
}
}