Skip to content

Commit 8325468

Browse files
committed
Tidy up error handling
1 parent 0185e91 commit 8325468

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/modules/select/wallets/ledger.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,10 @@ async function ledgerProvider(options: {
206206
disconnect()
207207
}
208208
},
209-
error: console.log,
210-
complete: console.log
209+
error: (error: any) => {
210+
throw new Error(error)
211+
},
212+
complete: () => {}
211213
}
212214

213215
if (CustomLedgerTransport) {
@@ -243,7 +245,9 @@ async function ledgerProvider(options: {
243245

244246
eth = new Eth(transport)
245247
} catch (error) {
246-
throw new Error('Error connecting to Ledger wallet')
248+
throw new Error(
249+
'An error occurred when trying to connect to your Ledger wallet'
250+
)
247251
}
248252
}
249253

0 commit comments

Comments
 (0)