Skip to content

Commit

Permalink
feat: better error message for unknown errors
Browse files Browse the repository at this point in the history
  • Loading branch information
0xKheops committed Jan 6, 2025
1 parent baec22a commit cc6be9b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion apps/extension/src/ui/hooks/ledger/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,15 @@ export const getTalismanLedgerError = (error: unknown, appName: string): Talisma

return new TalismanLedgerError(
"Unknown",
t("Failed to connect to your Ledger. Click here to retry."),
// this will attempt to display relevant info about the error, useful if users ask for help with a screenshot.
t(
"[{{label}}] Failed to connect to your Ledger. Make sure <strong>{{appName}}</strong> app is open and try again. {{message}}",
{
label: cause.name ?? cause.returnCode ?? cause.statusCode,
message: cause.message,
appName: capitalize(appName),
},
),
{ cause },
)
}
Expand Down

0 comments on commit cc6be9b

Please sign in to comment.