diff options
Diffstat (limited to 'packages')
-rw-r--r-- | packages/taler-wallet-core/src/wallet.ts | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/packages/taler-wallet-core/src/wallet.ts b/packages/taler-wallet-core/src/wallet.ts index 17fd74178..7eac73827 100644 --- a/packages/taler-wallet-core/src/wallet.ts +++ b/packages/taler-wallet-core/src/wallet.ts @@ -480,9 +480,9 @@ async function dumpCoins(ws: InternalWalletState): Promise<CoinDumpJson> { ageCommitmentProof: c.ageCommitmentProof, spend_allocation: c.spendAllocation ? { - amount: c.spendAllocation.amount, - id: c.spendAllocation.id, - } + amount: c.spendAllocation.amount, + id: c.spendAllocation.id, + } : undefined, }); } @@ -1524,8 +1524,15 @@ export class InternalWalletState { const myVersionChange = async (): Promise<void> => { logger.info("version change requested for Taler DB"); }; - const myDb = await openTalerDatabase(this.idb, myVersionChange); - this._db = myDb; + try { + const myDb = await openTalerDatabase(this.idb, myVersionChange); + this._db = myDb; + } catch (e) { + logger.error("error writing to database during initialization"); + throw TalerError.fromDetail(TalerErrorCode.WALLET_DB_UNAVAILABLE, { + innerError: getErrorDetailFromException(e), + }); + } } async getTransactionState( |