diff --git a/packages/transport/src/core/TransportCoreErrors.ts b/packages/transport/src/core/TransportCoreErrors.ts index eaa7f5e66..8193454b5 100644 --- a/packages/transport/src/core/TransportCoreErrors.ts +++ b/packages/transport/src/core/TransportCoreErrors.ts @@ -177,6 +177,10 @@ class Tokens { } class General { + public noIdentityFound() { + return new CoreError("error.transport.general.noIdentityFound", "No Identity was found and the identity creation is not enabled."); + } + public baseUrlNotSet() { return new CoreError("error.transport.general.baseUrlNotSet", "The baseUrl was not set."); } diff --git a/packages/transport/src/modules/accounts/AccountController.ts b/packages/transport/src/modules/accounts/AccountController.ts index 516406fd3..b4518065a 100644 --- a/packages/transport/src/modules/accounts/AccountController.ts +++ b/packages/transport/src/modules/accounts/AccountController.ts @@ -139,7 +139,7 @@ export class AccountController { if (!availableIdentityDoc && !availableDeviceDoc) { if (!deviceSharedSecret) { if (!this.config.allowIdentityCreation) { - throw new TransportError("No Identity found and identity creation is not allowed."); + throw TransportCoreErrors.general.noIdentityFound(); } // Identity creation