Skip to content

Commit 0441fcf

Browse files
authored
Merge pull request element-hq#2552 from vector-im/dbkr/electron_catch_unhandled_errors
Catch unhandled errors in the electron process
2 parents e033ce6 + b223d3b commit 0441fcf

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)