catch uncaught exception with ui creation scripts

prevent total webui crash
This commit is contained in:
w-e-w 2023-11-27 14:00:17 +09:00
parent f0f100e67b
commit 8a6e4bda21

View File

@ -570,6 +570,7 @@ class ScriptRunner:
if controls is None: if controls is None:
return return
try:
script.name = wrap_call(script.title, script.filename, "title", default=script.filename).lower() script.name = wrap_call(script.title, script.filename, "title", default=script.filename).lower()
api_args = [] api_args = []
@ -605,6 +606,9 @@ class ScriptRunner:
self.inputs += controls self.inputs += controls
script.args_to = len(self.inputs) script.args_to = len(self.inputs)
except Exception:
errors.report(f"Error creating UI for {script.name}: ", exc_info=True)
def setup_ui_for_section(self, section, scriptlist=None): def setup_ui_for_section(self, section, scriptlist=None):
if scriptlist is None: if scriptlist is None:
scriptlist = self.alwayson_scripts scriptlist = self.alwayson_scripts