Skip to content

Commit

Permalink
fixed a bug in error handling of balance fetching
Browse files Browse the repository at this point in the history
  • Loading branch information
H34D committed May 25, 2023
1 parent 3a664e5 commit e9eb4dc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/account/get-balances.ts
Expand Up @@ -78,7 +78,11 @@ export const getBalances = async (
} catch (error: unknown) {
if (error instanceof Error) {
console.error(
`Contract: ${contract.name} Wallet Address: ${addressToLoad} ${error.message}`
`Contract: ${await contract
.name()
.catch(() => contract.address)} Wallet Address: ${addressToLoad} ${
error.message
}`
);
}
}
Expand Down

0 comments on commit e9eb4dc

Please sign in to comment.