Improve error reporting when web_ui fails to load

Catch uncaught errors and display the error message on the page itself
if bootstraping fails. This should prevent most cases of the of the web
interface being stuck on "Loading web interface..." after an error was
thrown and the loading failed.
This commit is contained in:
Hornwitser committed 2023-11-29 19:01:46 +01:00
1 parent f1edbd78cb
commit 1434ede2dc
2 files changed
+25 -13

No files matched your search

+5 -4
View File
@@ -1,4 +1,5 @@
/* eslint-disable arrow-body-style, no-console */
import("@clusterio/web_ui").then(webUi => {
return webUi.bootstrap();
}).catch(console.error);
declare function scriptError(err: any): void;
import("@clusterio/web_ui")
.then(webUi => webUi.bootstrap())
.catch(scriptError)
;