From 843ec3030ce7459aff2361c0ac178c94e682e9be Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 20 Jan 2026 10:35:12 +0100 Subject: [PATCH] global-functions: make $ExitError a wrapper for $ExitOnError --- global-functions.rsc | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/global-functions.rsc b/global-functions.rsc index 34125892..4ef824b0 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -474,19 +474,16 @@ :return $Return; } -# simple macro to print error message on unintentional error +# wrapper for $ExitOnError with additional parameter :set ExitError do={ :local ExitOK [ :tostr $1 ]; :local Name [ :tostr $2 ]; :local Error [ :tostr $3 ]; - :global IfThenElse; - :global LogPrint; + :global ExitOnError; :if ($ExitOK = "false") do={ - $LogPrint error $Name ([ $IfThenElse ([ :pick $Name 0 1 ] = "\$") \ - "Function" "Script" ] . " '" . $Name . "' exited with error" . \ - [ $IfThenElse (!($Error ~ "^(|true|false)\$")) (": " . $Error) "." ]); + $ExitOnError $Name $Error; } }