Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.

Commit 22761d8

Browse files
committed
client: Display critical error toast instead of blank screen
1 parent 7bb70bb commit 22761d8

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/public/app/desktop.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,24 @@ import appContext from "./components/app_context.js";
22
import utils from './services/utils.js';
33
import noteTooltipService from './services/note_tooltip.js';
44
import bundleService from "./services/bundle.js";
5+
import toastService from "./services/toast.js";
56
import noteAutocompleteService from './services/note_autocomplete.js';
67
import macInit from './services/mac_init.js';
78
import electronContextMenu from "./menus/electron_context_menu.js";
89
import DesktopLayout from "./layouts/desktop_layout.js";
910
import glob from "./services/glob.js";
1011

1112
bundleService.getWidgetBundlesByParent().then(widgetBundles => {
12-
appContext.setLayout(new DesktopLayout(widgetBundles));
13-
appContext.start();
13+
appContext.setLayout(new DesktopLayout(widgetBundles));
14+
appContext.start()
15+
.catch((e) => {
16+
toastService.showPersistent({
17+
title: "Critical error",
18+
icon: "alert",
19+
message: `A critical error has occurred which prevents the client application from starting:\n\n${e.message}\n\nThis is most likely caused by a script failing in an unexpected way. Try starting the application in safe mode and addressing the issue.`,
20+
});
21+
console.error("Critical error occured", e);
22+
});
1423
});
1524

1625
glob.setupGlobs();

0 commit comments

Comments
 (0)