Delete unnecessary red banners
[portal/nonrtric-controlpanel.git] / webapp-frontend / src / app / interceptor.ts
index 65ce887..3bceb5e 100644 (file)
@@ -27,18 +27,27 @@ import { NotificationService } from '@services/ui/notification.service';
 
 @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>>;
+        }
     }
 }