Skip to content

Commit

Permalink
fix(core): improve wallet not initialized error (#513)
Browse files Browse the repository at this point in the history
Signed-off-by: Timo Glastra <[email protected]>
  • Loading branch information
TimoGlastra authored Nov 1, 2021
1 parent 4fb797f commit b948d4c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/core/src/wallet/IndyWallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,19 @@ 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
}

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
Expand Down

0 comments on commit b948d4c

Please sign in to comment.