Skip to content

Commit b223d3b

Browse files
committed
Catch unhandled errors in the electron process
Otherwise we pop up stack traces in dialog boxes if it fails to to poll for updates or something.
1 parent e033ce6 commit b223d3b

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎electron/src/electron-main.js‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,16 @@ function pollForUpdates() {
9191
}
9292
}
9393

94+
// handle uncaught errors otherwise it displays
95+
// stack traces in popup dialogs, which is terrible (which
96+
// it will do any time the auto update poke fails, and there's
97+
// no other way to catch this error).
98+
// Assuming we generally run from the console when developing,
99+
// this is far preferable.
100+
process.on('uncaughtException', function (error) {
101+
console.log("Unhandled exception", error);
102+
});
103+
94104
electron.ipcMain.on('install_update', installUpdate);
95105

96106
electron.app.on('ready', () => {

0 commit comments

Comments
 (0)