From 178573ce95220f4bcfae6013cbf8b544a1580307 Mon Sep 17 00:00:00 2001 From: Jack Amadeo Date: Fri, 12 Sep 2025 15:49:37 -0400 Subject: [PATCH] Catch errors in node main (#4627) --- ui/desktop/src/main.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ui/desktop/src/main.ts b/ui/desktop/src/main.ts index bab5333273..5361ec01cb 100644 --- a/ui/desktop/src/main.ts +++ b/ui/desktop/src/main.ts @@ -1675,7 +1675,7 @@ const registerGlobalHotkey = (accelerator: string) => { } }; -app.whenReady().then(async () => { +async function appMain() { // Ensure Windows shims are available before any MCP processes are spawned await ensureWinShims(); @@ -2144,6 +2144,15 @@ app.whenReady().then(async () => { return false; } }); +} + +app.whenReady().then(async () => { + try { + await appMain(); + } catch (error) { + dialog.showErrorBox('Goose Error', `Failed to create main window: ${error}`); + app.quit(); + } }); async function getAllowList(): Promise {