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:
@@ -82,8 +82,12 @@ class Base_gui_class {
|
|||||||
modules_context.keys().forEach(function (key) {
|
modules_context.keys().forEach(function (key) {
|
||||||
if (key.indexOf('Base' + '/') < 0) {
|
if (key.indexOf('Base' + '/') < 0) {
|
||||||
var moduleKey = key.replace('./', '').replace('.js', '');
|
var moduleKey = key.replace('./', '').replace('.js', '');
|
||||||
var classObj = modules_context(key);
|
try {
|
||||||
_this.modules[moduleKey] = new classObj.default();
|
var classObj = modules_context(key);
|
||||||
|
_this.modules[moduleKey] = new classObj.default();
|
||||||
|
} catch (e) {
|
||||||
|
console.error('[load_modules] Failed to load ' + key + ':', e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user