taler-typescript-core

Wallet core logic and WebUIs for various components
Log | Files | Refs | Submodules | README | LICENSE

commit 3b5c5f4a9d55cec9db2687f81042cedeb6f6321f
parent 750700a45b01060bd3a26a6769e03844aaddb334
Author: Sebastian <sebasjm@gmail.com>
Date:   Wed, 21 Feb 2024 17:13:44 -0300

wip #8371

Diffstat:
Mpackages/taler-wallet-core/src/wallet.ts | 17++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)

diff --git 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(