diff options
author | Christian Hesse <mail@eworm.de> | 2022-04-28 09:55:28 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2022-04-28 10:19:07 +0200 |
commit | e74bec7e5b62e54d10b1f3ba058868536b35fdc6 (patch) | |
tree | a6640f747b31e076a4f19d03436f46c6bdfec0d1 /global-functions | |
parent | 7c8e230521f1a936da034dfc05197fe9434926ed (diff) |
global-functions: catch runtime error when loading modules
Diffstat (limited to 'global-functions')
-rw-r--r-- | global-functions | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/global-functions b/global-functions index 397a10d..6cd6b85 100644 --- a/global-functions +++ b/global-functions @@ -1269,7 +1269,11 @@ :foreach Script in=[ / system script find where name ~ "^mod/." ] do={ :local ScriptVal [ / system script get $Script ]; :if ([ $ValidateSyntax ($ScriptVal->"source") ] = true) do={ - / system script run $Script; + :do { + / system script run $Script; + } on-error={ + $LogPrintExit2 error $0 ("Module '" . $ScriptVal->"name" . "' failed to run.") false; + } } else={ $LogPrintExit2 error $0 ("Module '" . $ScriptVal->"name" . "' failed syntax validation, skipping.") false; } |