summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/wallet.ts
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2024-02-21 17:13:44 -0300
committerSebastian <sebasjm@gmail.com>2024-02-21 17:13:44 -0300
commit3b5c5f4a9d55cec9db2687f81042cedeb6f6321f (patch)
tree0702de2fc071b761697ad0bac9c871d5a4d133fd /packages/taler-wallet-core/src/wallet.ts
parent750700a45b01060bd3a26a6769e03844aaddb334 (diff)
downloadwallet-core-3b5c5f4a9d55cec9db2687f81042cedeb6f6321f.tar.gz
wallet-core-3b5c5f4a9d55cec9db2687f81042cedeb6f6321f.tar.bz2
wallet-core-3b5c5f4a9d55cec9db2687f81042cedeb6f6321f.zip
wip #8371
Diffstat (limited to 'packages/taler-wallet-core/src/wallet.ts')
-rw-r--r--packages/taler-wallet-core/src/wallet.ts17
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(