fix: error handling for Ledger hardware wallet errors#40597
Merged
Conversation
Contributor
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
Contributor
|
We should be able to use this util to create the error metamask-extension/ui/contexts/hardware-wallets/rpcErrorUtils.ts Lines 503 to 508 in d42a431 |
Contributor
Builds ready [c384961]
⚡ Performance Benchmarks
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Contributor
Builds ready [da11506]
⚡ Performance Benchmarks
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Contributor
Builds ready [21eb102]
⚡ Performance Benchmarks
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
|
Contributor
Builds ready [b646dc9]
⚡ Performance Benchmarks
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
hmalik88
approved these changes
Mar 4, 2026
gantunesr
approved these changes
Mar 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
This PR adds fix for error handling and message display for Ledger hardware wallets.
Changelog
CHANGELOG entry: Fix error message displayed for Ledger hardware wallets
Related issues
Fixes: #39726
Manual testing steps
Screenshots/Recordings
Before
After
Testing with multiple apps or when all are closed
Test device used: Ledger Flex
Browser: Chrome
Running local extension build from
mainPre-merge author checklist
Pre-merge reviewer checklist
Note
Low Risk
Low risk UI behavior change limited to Ledger connect error messaging; main risk is misclassification of certain errors leading to different user-facing messages.
Overview
Improves Ledger hardware-wallet connection error display by first mapping thrown errors through shared
hw-wallet-sdklogic (toHardwareWalletError) and showing the SDK-provideduserMessagefor recognized Ledger status codes (excludingUnknown/ConnectionClosed).Keeps the existing fallback error parsing for U2F/timeout/legacy Ledger error codes, but updates
LEDGER_ERRORS_CODESmessages to be localized viat.Adds tests covering the new Ledger mapping behavior (mapped status code shows SDK message; unmapped/connection-closed cases fall back to the original error message).
Written by Cursor Bugbot for commit b646dc9. This will update automatically on new commits. Configure here.