From: Volker Theile Date: Thu, 19 Apr 2018 08:24:17 +0000 (+0200) Subject: mgr/dashboard: Do not show notifications for HTTP 409 errors. X-Git-Tag: v13.1.0~180^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9db2d058bc6b186faa50c13ca8621b0c7b1fd665;p=ceph.git mgr/dashboard: Do not show notifications for HTTP 409 errors. Signed-off-by: Volker Theile --- diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/api-interceptor.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/api-interceptor.service.ts index d412119bbc28..ed5ea8fac946 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/api-interceptor.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/api-interceptor.service.ts @@ -26,6 +26,7 @@ export class ApiInterceptorService implements HttpInterceptor { intercept(request: HttpRequest, next: HttpHandler): Observable> { return next.handle(request).catch(resp => { if (resp instanceof HttpErrorResponse) { + let showNotification = true; switch (resp.status) { case 401: this.authStorageService.remove(); @@ -34,11 +35,15 @@ export class ApiInterceptorService implements HttpInterceptor { case 404: this.router.navigate(['/404']); break; + case 409: + showNotification = false; + break; + } + if (showNotification) { + this.notificationService.show(NotificationType.error, + resp.error.detail || '', + `${resp.status} - ${resp.statusText}`); } - this.notificationService.show( - NotificationType.error, - resp.error.detail || '', - `${resp.status} - ${resp.statusText}`); } // Return the error to the method that called it. return Observable.throw(resp);