mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-07-31 16:24:25 +02:00
global-functions: $ExitError: give matching message for functions
This commit is contained in:
parent
e51191035b
commit
ff00c27f99
1 changed files with 5 additions and 3 deletions
|
@ -428,13 +428,15 @@
|
|||
|
||||
# simple macro to print error message on unintentional error
|
||||
:set ExitError do={
|
||||
:local ExitOK [ :tostr $1 ];
|
||||
:local ScriptName [ :tostr $2 ];
|
||||
:local ExitOK [ :tostr $1 ];
|
||||
:local Name [ :tostr $2 ];
|
||||
|
||||
:global IfThenElse;
|
||||
:global LogPrint;
|
||||
|
||||
:if ($ExitOK = "false") do={
|
||||
$LogPrint error $ScriptName ("Script '" . $ScriptName . "' exited with error.");
|
||||
$LogPrint error $Name ([ $IfThenElse ([ :pick $Name 0 1 ] = "\$") \
|
||||
"Function" "Script" ] . " '" . $Name . "' exited with error.");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue