Fix: wrap load_modules() in try/catch so a bad module constructor never kills GUI init

Without this, any constructor throw in any module stops load_modules() mid-loop
and render_main_gui() (which builds the menu) never runs — resulting in a blank
page with no menu. The failing module is now logged to the browser console
instead of silently aborting startup.

https://claude.ai/code/session_01WVDg7amsy1TTtxvpku7bcM
This commit is contained in:
Claude
2026-06-13 22:43:15 +00:00
parent 0514f5b67b
commit 2a0c414a1c
+6 -2
View File
@@ -82,8 +82,12 @@ class Base_gui_class {
modules_context.keys().forEach(function (key) {
if (key.indexOf('Base' + '/') < 0) {
var moduleKey = key.replace('./', '').replace('.js', '');
var classObj = modules_context(key);
_this.modules[moduleKey] = new classObj.default();
try {
var classObj = modules_context(key);
_this.modules[moduleKey] = new classObj.default();
} catch (e) {
console.error('[load_modules] Failed to load ' + key + ':', e);
}
}
});
}