From 2845f1f2881840ecc1409ee2ebd37a9ddd14c4dd Mon Sep 17 00:00:00 2001 From: Andreas Coroiu Date: Thu, 11 May 2023 13:55:10 +0200 Subject: [PATCH] [PM-2014] feat: improve error on delete --- .../auth/core/services/webauthn/webauthn.service.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/apps/web/src/app/auth/core/services/webauthn/webauthn.service.ts b/apps/web/src/app/auth/core/services/webauthn/webauthn.service.ts index b4285f5b7f..7c09aa51e0 100644 --- a/apps/web/src/app/auth/core/services/webauthn/webauthn.service.ts +++ b/apps/web/src/app/auth/core/services/webauthn/webauthn.service.ts @@ -121,8 +121,16 @@ export class WebauthnService { this.refresh(); return true; } catch (error) { - this.logService?.error(error); - this.platformUtilsService.showToast("error", null, this.i18nService.t("unexpectedError")); + if (error instanceof ErrorResponse && error.statusCode === 400) { + this.platformUtilsService.showToast( + "error", + this.i18nService.t("error"), + this.i18nService.t("invalidMasterPassword") + ); + } else { + this.logService?.error(error); + this.platformUtilsService.showToast("error", null, this.i18nService.t("unexpectedError")); + } return false; } }