Skip to content

Commit

Permalink
[BUG] Storage error alert not showing
Browse files Browse the repository at this point in the history
Closes #293
  • Loading branch information
tombeckenham committed Dec 16, 2024
1 parent 735120d commit 491d4b5
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/background/controller/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 491d4b5

Please sign in to comment.