mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-06-23 10:08:40 +02:00
global-functions: catch runtime error when loading modules
(cherry picked from commit e74bec7e5b
)
This commit is contained in:
parent
4cda1281f1
commit
0479f59aa4
1 changed files with 5 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue