mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-07-09 01:24:27 +02:00
global-functions: introduce $ExitError...
... as a simple macro to print error message on unintentional error.
This commit is contained in:
parent
48bcf8ee6e
commit
0d69f8952c
1 changed files with 13 additions and 0 deletions
|
@ -32,6 +32,7 @@
|
||||||
:global DownloadPackage;
|
:global DownloadPackage;
|
||||||
:global EitherOr;
|
:global EitherOr;
|
||||||
:global EscapeForRegEx;
|
:global EscapeForRegEx;
|
||||||
|
:global ExitError;
|
||||||
:global FetchHuge;
|
:global FetchHuge;
|
||||||
:global FetchUserAgentStr;
|
:global FetchUserAgentStr;
|
||||||
:global FormatLine;
|
:global FormatLine;
|
||||||
|
@ -425,6 +426,18 @@
|
||||||
:return $Return;
|
:return $Return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# simple macro to print error message on unintentional error
|
||||||
|
:set ExitError do={
|
||||||
|
:local ExitOK [ :tostr $1 ];
|
||||||
|
:local ScriptName [ :tostr $2 ];
|
||||||
|
|
||||||
|
:global LogPrint;
|
||||||
|
|
||||||
|
:if ($ExitOK = "false") do={
|
||||||
|
$LogPrint error $ScriptName ("Script exited with error.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
# fetch huge data to file, read in chunks
|
# fetch huge data to file, read in chunks
|
||||||
:set FetchHuge do={
|
:set FetchHuge do={
|
||||||
:local ScriptName [ :tostr $1 ];
|
:local ScriptName [ :tostr $1 ];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue