diff --git a/packages/app-runtime/src/multiAccount/MultiAccountController.ts b/packages/app-runtime/src/multiAccount/MultiAccountController.ts index c8a0eef5f..55728c7ec 100644 --- a/packages/app-runtime/src/multiAccount/MultiAccountController.ts +++ b/packages/app-runtime/src/multiAccount/MultiAccountController.ts @@ -99,7 +99,16 @@ export class MultiAccountController { this._log.trace(`Initializing AccountController for local account ${id}...`); const accountController = new AccountController(this.transport, db, this.transport.config); - await accountController.init(); + + await accountController.init().catch((error) => { + if (error instanceof CoreError && TransportCoreErrors.general.accountControllerInitialSyncFailed().equals(error)) { + this._log.error(`Initial sync of AccountController for local account ${id} failed.`, error); + return; + } + + throw error; + }); + this._log.trace(`AccountController for local account ${id} initialized.`); this._openAccounts[localAccount.id.toString()] = accountController; diff --git a/packages/transport/src/core/TransportCoreErrors.ts b/packages/transport/src/core/TransportCoreErrors.ts index 15a6db820..4c96e5139 100644 --- a/packages/transport/src/core/TransportCoreErrors.ts +++ b/packages/transport/src/core/TransportCoreErrors.ts @@ -197,6 +197,10 @@ class General { public invalidTruncatedReference() { return new CoreError("error.transport.files.invalidTruncatedReference", "invalid truncated reference"); } + + public accountControllerInitialSyncFailed() { + return new CoreError("error.transport.accountControllerInitialSyncFailed", "The initial sync of the AccountController failed."); + } } export class TransportCoreErrors { diff --git a/packages/transport/src/modules/accounts/AccountController.ts b/packages/transport/src/modules/accounts/AccountController.ts index d535b1324..3286d03e9 100644 --- a/packages/transport/src/modules/accounts/AccountController.ts +++ b/packages/transport/src/modules/accounts/AccountController.ts @@ -182,7 +182,10 @@ export class AccountController { await this.syncDatawallet(); await this.devices.update(device!); } - await this.syncDatawallet(); + + await this.syncDatawallet().catch(() => { + throw TransportCoreErrors.general.accountControllerInitialSyncFailed(); + }); return this; }