mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-06-21 01:15:42 +02:00
global-functions: $ExitError: support to pass in error message
This commit is contained in:
parent
ccfe1a781e
commit
90f61d3d75
1 changed files with 3 additions and 1 deletions
|
@ -452,13 +452,15 @@
|
|||
:set ExitError do={
|
||||
:local ExitOK [ :tostr $1 ];
|
||||
:local Name [ :tostr $2 ];
|
||||
:local Error [ :tostr $3 ];
|
||||
|
||||
:global IfThenElse;
|
||||
:global LogPrint;
|
||||
|
||||
:if ($ExitOK = "false") do={
|
||||
$LogPrint error $Name ([ $IfThenElse ([ :pick $Name 0 1 ] = "\$") \
|
||||
"Function" "Script" ] . " '" . $Name . "' exited with error.");
|
||||
"Function" "Script" ] . " '" . $Name . "' exited with error" . \
|
||||
[ $IfThenElse (!($Error ~ "^(|true|false)\$")) (": " . $Error) "." ]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue