fix rare bad shutdown loop with logger throwing errors (#1001)

This commit is contained in:
Mike Sawka 2024-10-09 16:15:42 -07:00 committed by GitHub
parent 4f00595311
commit 9ad8068d13
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -997,8 +997,9 @@ process.on("uncaughtException", (error) => {
if (caughtException) {
return;
}
logger.error("Uncaught Exception, shutting down: ", error);
caughtException = true;
console.log("Uncaught Exception, shutting down: ", error);
console.log("Stack Trace:", error.stack);
// Optionally, handle cleanup or exit the app
electronApp.quit();
});
@ -1033,12 +1034,6 @@ async function relaunchBrowserWindows(): Promise<void> {
}
}
process.on("uncaughtException", (error) => {
console.error("Uncaught Exception:", error);
console.error("Stack Trace:", error.stack);
electron.app.quit();
});
async function appMain() {
// Set disableHardwareAcceleration as early as possible, if required.
const launchSettings = getLaunchSettings();