Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.
Add new error codes (#2159)
Leendert de Borst15e1714634bb
diff --git a/apps/browser-extension/src/utils/types/errors/AppErrorCodes.ts b/apps/browser-extension/src/utils/types/errors/AppErrorCodes.tsindex d90813b5b..13c8eaa50 100644--- a/apps/browser-extension/src/utils/types/errors/AppErrorCodes.ts+++ b/apps/browser-extension/src/utils/types/errors/AppErrorCodes.ts@@ -72,6 +72,7 @@ export enum AppErrorCode {// Migration/version errors (E-9xx)MIGRATION_CHECK_FAILED = 'E-901',VERSION_INCOMPATIBLE = 'E-902',+ SERVER_UPDATE_REQUIRED = 'E-903',}/**@@ -167,6 +168,7 @@ export function getErrorTranslationKey(code: AppErrorCode): string {// Migration/version errors (E-9xx)[AppErrorCode.MIGRATION_CHECK_FAILED]: 'common.errors.unknownErrorTryAgain',[AppErrorCode.VERSION_INCOMPATIBLE]: 'common.errors.browserExtensionOutdated',+ [AppErrorCode.SERVER_UPDATE_REQUIRED]: 'common.errors.serverVersionNotSupported',};return codeToKeyMap[code] || 'common.errors.unknownErrorTryAgain';diff --git a/apps/browser-extension/src/utils/types/errors/ServerUpdateRequiredError.ts b/apps/browser-extension/src/utils/types/errors/ServerUpdateRequiredError.tsnew file mode 100644index 000000000..968821069--- /dev/null+++ b/apps/browser-extension/src/utils/types/errors/ServerUpdateRequiredError.ts@@ -0,0 +1,14 @@+/**+ * Thrown when the AliasVault server does not expose the v2 vault API (the v2 endpoints return HTTP 404).+ */+export class ServerUpdateRequiredError extends Error {+ /**+ * Creates a new instance of ServerUpdateRequiredError.+ * @param message - The error message.+ */+ public constructor(message: string = 'The AliasVault server does not support the v2 vault API and needs to be updated') {+ super(message);+ this.name = 'ServerUpdateRequiredError';+ Object.setPrototypeOf(this, ServerUpdateRequiredError.prototype);+ }+}