Skip to content

Commit

Permalink
Ensure app startup errors are logged in the main log
Browse files Browse the repository at this point in the history
  • Loading branch information
webfiltered committed Dec 14, 2024
1 parent 23aa361 commit 1c9725e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ async function startApp() {
const store = await DesktopConfig.load(shell);
if (!store) throw new Error('Unknown error loading app config on startup.');
} catch (error) {
log.error('Unhandled exception during config load', error);
dialog.showErrorBox('User Data', `Unknown error whilst writing to user data folder:\n\n${error}`);
app.exit(20);
return;
Expand Down Expand Up @@ -99,11 +100,12 @@ async function startApp() {
appWindow.sendServerStartProgress(ProgressStatus.READY);
await appWindow.loadComfyUI({ host, port, extraServerArgs });
} catch (error) {
log.error('Unhandled exception during app startup', error);
appWindow.sendServerStartProgress(ProgressStatus.ERROR);
appWindow.send(IPC_CHANNELS.LOG_MESSAGE, error);
}
} catch (error) {
log.error('Fatal error occurred during app startup.', error);
log.error('Fatal error occurred during app pre-startup.', error);
app.exit(2024);
}
}

0 comments on commit 1c9725e

Please sign in to comment.