From abbf899b97ed09f215455be3cab8501b5da92860 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 9 Aug 2021 10:42:56 -0300 Subject: [PATCH] add ex handling on wallet init --- packages/taler-wallet-webextension/src/wxBackend.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/taler-wallet-webextension/src/wxBackend.ts b/packages/taler-wallet-webextension/src/wxBackend.ts index 8bbfc0c1d..e1517c4cf 100644 --- a/packages/taler-wallet-webextension/src/wxBackend.ts +++ b/packages/taler-wallet-webextension/src/wxBackend.ts @@ -261,7 +261,13 @@ async function reinitWallet(): Promise { http, new BrowserCryptoWorkerFactory(), ); - await wallet.handleCoreApiRequest("initWallet", "native-init", {}); + try { + await wallet.handleCoreApiRequest("initWallet", "native-init", {}); + } catch (e) { + console.error("could not initialize wallet", e); + walletInit.reject(e); + return; + } wallet.addNotificationListener((x) => { for (const x of notificationPorts) { try {