aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2022-04-28 09:55:28 +0200
committerGravatar Christian Hesse <mail@eworm.de>2022-04-28 10:39:25 +0200
commit0479f59aa43bb706abed42c233cde000c7f86ffc (patch)
tree283f93e5ac52e32bc74b695b24eaeb3568687fac
parent4cda1281f1d83208bf6a6c704cbf67b7e7e83b8a (diff)
global-functions: catch runtime error when loading modules
(cherry picked from commit e74bec7e5b62e54d10b1f3ba058868536b35fdc6)
-rw-r--r--global-functions6
1 files changed, 5 insertions, 1 deletions
diff --git a/global-functions b/global-functions
index 89234f9..f212759 100644
--- a/global-functions
+++ b/global-functions
@@ -1273,7 +1273,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;
}