Skip to content

Commit

Permalink
Merge pull request #294 from Outblock:293-bug-storage-error-alert-not…
Browse files Browse the repository at this point in the history
…-showing

[BUG] Storage error alert not showing
  • Loading branch information
tombeckenham authored Dec 17, 2024
2 parents 735120d + 491d4b5 commit aefa24b
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 aefa24b

Please sign in to comment.