Skip to content

Commit

Permalink
Fix LIVE-12926 (#7554)
Browse files Browse the repository at this point in the history
handle uncaughtException to console instead of Electron GUI (#7546)
  • Loading branch information
gre authored Aug 8, 2024
1 parent 444003e commit 3a9de0c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/pretty-cooks-grin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"ledger-live-desktop": patch
---

Prevent uncaughtException errors to be seen to the user.
9 changes: 9 additions & 0 deletions apps/ledger-live-desktop/src/main/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,15 @@ ipcMain.handle("deactivate-keep-screen-awake", (_ev, id?: number) => {

process.setMaxListeners(0);

// In production mode, we do not want Electron's default GUI to show the error. Instead we will output to the console.
if (!__DEV__) {
process.on("uncaughtException", function (error) {
const stack = error.stack ? error.stack : `${error.name}: ${error.message}`;
const message = "Uncaught Exception:\n" + stack;
console.error(message);
});
}

// eslint-disable-next-line no-console
console.log(`Ledger Live ${__APP_VERSION__}`);
contextMenu({
Expand Down

0 comments on commit 3a9de0c

Please sign in to comment.