From 9ad8068d132433c75c021554eee8c3986fcdacb2 Mon Sep 17 00:00:00 2001 From: Mike Sawka Date: Wed, 9 Oct 2024 16:15:42 -0700 Subject: [PATCH] fix rare bad shutdown loop with logger throwing errors (#1001) --- emain/emain.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/emain/emain.ts b/emain/emain.ts index 34f37fb0e..9f47b4033 100644 --- a/emain/emain.ts +++ b/emain/emain.ts @@ -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 { } } -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();