Skip to content

Commit

Permalink
Merge pull request LedgerHQ#1899 from LedgerHQ/support/LIVE-3432
Browse files Browse the repository at this point in the history
LIVE-3432 - LLD - Handle ECONNRESET error with better message
  • Loading branch information
LFBarreto authored Nov 24, 2022
2 parents 8267609 + f29d3d9 commit cafbd5d
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/ninety-eggs-look.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"ledger-live-desktop": patch
---

LLD - Handle ECONNRESET error in manager
5 changes: 5 additions & 0 deletions .changeset/sour-snakes-fry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@ledgerhq/live-common": patch
---

LLC - Errors - add custom error
2 changes: 2 additions & 0 deletions apps/ledger-live-desktop/src/config/urls.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,8 @@ export const urls = {
SyncError:
"https://support.ledger.com/hc/en-us/articles/360012207759-Solve-a-synchronization-error?support=true",
ServiceStatusWarning: "https://status.ledger.com",
EConnReset:
"https://support.ledger.com/hc/en-us/articles/6793501085981?support=true&utm_source=ledger_live_desktop&utm_medium=self_referral&utm_content=error_connect_manager",
},
compound:
"https://support.ledger.com/hc/en-us/articles/360017215099?utm_source=ledger_live_desktop&utm_medium=self_referral&utm_content=compound",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
LatestFirmwareVersionRequired,
DeviceNotOnboarded,
NoSuchAppOnProvider,
EConnResetError,
} from "@ledgerhq/live-common/errors";
import { getCurrentDevice } from "~/renderer/reducers/devices";
import { setPreferredDeviceModel, setLastSeenDeviceInfo } from "~/renderer/actions/settings";
Expand Down Expand Up @@ -293,6 +294,15 @@ export const DeviceActionDefaultRendering = <R, H, P>({
});
}

// workarround to catch ECONNRESET error and show better message
if (error?.message?.includes("ECONNRESET")) {
return renderError({
error: new EConnResetError(),
onRetry,
withExportLogs: true,
});
}

return renderError({
t,
error,
Expand Down
8 changes: 6 additions & 2 deletions apps/ledger-live-desktop/static/i18n/en/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -3659,11 +3659,11 @@
"title": "Test Post Onboarding",
"description": "Test all post onboarding features"
},
"1559DeactivateGate" : {
"1559DeactivateGate": {
"title": "Deactivate EIP1559 minimum priority fee gate",
"description": "This will allow a transaction to be sent without any minimum priority fee expected. This may result in a transaction getting stuck in the mempool forever."
},
"1559CustomPriorityLowerGate" : {
"1559CustomPriorityLowerGate": {
"title": "Custom priority fee gate",
"description": "Customize the percentage of our estimated minimal priority fee allowed for an advanced EIP1559 transaction"
}
Expand Down Expand Up @@ -4749,6 +4749,10 @@
"title": "Sorry, it looks like your device disconnected",
"description": "Please reconnect and try again."
},
"EConnReset": {
"title": "The Ledger application store can't be reached",
"description": "Your internet connection may be down or using unusual configuration. Start by verifying if anything is blocking your connection (proxy or firewall). If the problem persists click below for solutions or reach out to our customer support."
},
"EnpointConfig": {
"title": "Invalid endpoint",
"description": "Please provide a valid endpoint"
Expand Down
2 changes: 2 additions & 0 deletions libs/ledger-live-common/src/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,8 @@ export const UnsupportedDerivation = createCustomErrorClass(
"UnsupportedDerivation"
);

export const EConnResetError = createCustomErrorClass("EConnReset");

export * from "./families/polkadot/errors";
export * from "./families/stellar/errors";
export * from "./families/solana/errors";
Expand Down

0 comments on commit cafbd5d

Please sign in to comment.