Skip to content

Commit

Permalink
refactor: pretty error message
Browse files Browse the repository at this point in the history
  • Loading branch information
homura committed Jul 26, 2024
1 parent 4f88e23 commit 056a993
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions packages/neuron-wallet/src/services/hardware/ledger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,20 +81,20 @@ export default class Ledger extends Hardware {
const hdPath = path === hd.AccountExtendedPublicKey.pathForReceiving(0) ? this.defaultPath : path
const signature = await this.ledgerCKB!.signTransaction(hdPath, rawTx, witnesses, context, this.defaultPath).catch(
error => {
if (error instanceof Error) {
logger.error(
'Ledger: failed to sign the transaction',
error.message,
' HD path:',
hdPath,
' raw transaction:',
JSON.stringify(rawTx),
' witnesses:',
JSON.stringify(witnesses),
' context:',
JSON.stringify(context)
)
}
const errorMessage = error instanceof Error ? error.message : String(error)
logger.error(
'Ledger: failed to sign the transaction ',
errorMessage,
' HD path:',
hdPath,
' raw transaction:',
JSON.stringify(rawTx),
' witnesses:',
JSON.stringify(witnesses),
' context:',
JSON.stringify(context)
)

return Promise.reject(error)
}
)
Expand Down

1 comment on commit 056a993

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Packaging for test is done in 10106938184

Please sign in to comment.