Skip to content

Commit

Permalink
Show error details if possible
Browse files Browse the repository at this point in the history
  • Loading branch information
apporc committed Jun 25, 2024
1 parent 0dd6306 commit 7264d30
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/pages/earn/index.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@
if ($currentAccount && $currentAccount.rex_info && $currentAccount.rex_info.rex_balance) {
return $currentAccount.rex_info.rex_balance
}
return undefined
return Asset.from(0, $systemToken!.symbol)
})
async function handleConfirm(context: FormTransaction) {
Expand All @@ -209,7 +209,11 @@
} catch (e) {
console.warn('Error during transact', e)
if (context) {
context.setTransactionError(e)
let msg = String(e)
if (e.details && e.details.length > 0 && e.details[0].message) {
msg = e.details[0].message
}
context.setTransactionError(msg)
}
}
}
Expand Down

0 comments on commit 7264d30

Please sign in to comment.