diff options
author | Christian Hesse <mail@eworm.de> | 2024-12-09 09:55:12 +0100 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2024-12-09 11:49:50 +0100 |
commit | ff00c27f990b851b9d14f708aecae6087fedc011 (patch) | |
tree | 545552bfc0073371c237d90a9d89631e021a0bf1 | |
parent | e51191035b21c529efb4387dfe59976c3112f561 (diff) |
global-functions: $ExitError: give matching message for functions
-rw-r--r-- | global-functions.rsc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/global-functions.rsc b/global-functions.rsc index 8941994..6c74c2f 100644 --- a/global-functions.rsc +++ b/global-functions.rsc @@ -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."); } } |