From e7dac2c9e304f7baf2c2813d0ee46d698a877fd2 Mon Sep 17 00:00:00 2001 From: Timo Glastra Date: Mon, 1 Nov 2021 19:46:04 +0100 Subject: [PATCH] fix(core): improve wallet not initialized error Signed-off-by: Timo Glastra --- packages/core/src/wallet/IndyWallet.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/core/src/wallet/IndyWallet.ts b/packages/core/src/wallet/IndyWallet.ts index bff86417be..97cd71b30b 100644 --- a/packages/core/src/wallet/IndyWallet.ts +++ b/packages/core/src/wallet/IndyWallet.ts @@ -44,7 +44,9 @@ export class IndyWallet implements Wallet { public get handle() { if (!this.isInitialized || !this.openWalletInfo) { - throw new AriesFrameworkError('Wallet has not been initialized yet') + throw new AriesFrameworkError( + 'Wallet has not been initialized yet. Make sure to await agent.initialize() before using the agent.' + ) } return this.openWalletInfo.walletHandle @@ -52,7 +54,9 @@ export class IndyWallet implements Wallet { public get masterSecretId() { if (!this.isInitialized || !this.openWalletInfo) { - throw new AriesFrameworkError('Wallet has not been initialized yet') + throw new AriesFrameworkError( + 'Wallet has not been initialized yet. Make sure to await agent.initialize() before using the agent.' + ) } return this.openWalletInfo.masterSecretId