From 491d4b5b0afe6cf5ab124ba40fa8fd4cc3f5f7ee Mon Sep 17 00:00:00 2001 From: Tom Beckenham <34339192+tombeckenham@users.noreply.github.com> Date: Mon, 16 Dec 2024 18:55:31 +1100 Subject: [PATCH] [BUG] Storage error alert not showing Closes #293 --- src/background/controller/wallet.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/background/controller/wallet.ts b/src/background/controller/wallet.ts index afe306ed..bb1e8171 100644 --- a/src/background/controller/wallet.ts +++ b/src/background/controller/wallet.ts @@ -3494,19 +3494,18 @@ export class WalletController extends BaseController { } } catch (err: unknown) { // An error has occurred while listening to the transaction - console.log(typeof err); - console.log({ err }); - console.error('listenTransaction error ', err); let errorMessage = 'unknown error'; let errorCode: number | undefined = undefined; if (err instanceof TransactionError) { errorCode = err.code; errorMessage = err.message; - } else if (err instanceof Error) { - errorMessage = err.message; - } else if (typeof err === 'string') { - errorMessage = err; + } else { + if (err instanceof Error) { + errorMessage = err.message; + } else if (typeof err === 'string') { + errorMessage = err; + } // From fcl-core transaction-error.ts const ERROR_CODE_REGEX = /\[Error Code: (\d+)\]/; const match = errorMessage.match(ERROR_CODE_REGEX);