global-functions: use :onerror for outer block

This commit is contained in:
Christian Hesse 2025-05-06 09:49:49 +02:00
parent 90f61d3d75
commit 41bf9677db

View file

@ -1119,7 +1119,7 @@
} }
# install new scripts, update existing scripts # install new scripts, update existing scripts
:set ScriptInstallUpdate do={ :do { :set ScriptInstallUpdate do={ :onerror Err {
:local Scripts [ :toarray $1 ]; :local Scripts [ :toarray $1 ];
:local NewComment [ :tostr $2 ]; :local NewComment [ :tostr $2 ];
@ -1396,8 +1396,8 @@
:set GlobalConfigChanges; :set GlobalConfigChanges;
:set GlobalConfigMigration; :set GlobalConfigMigration;
} }
} on-error={ } do={
:global ExitError; $ExitError false $0; :global ExitError; $ExitError false $0 $Err;
} } } }
# lock script against multiple invocation # lock script against multiple invocation
@ -1538,12 +1538,12 @@
} }
# send notification via NotificationFunctions - expects at least two string arguments # send notification via NotificationFunctions - expects at least two string arguments
:set SendNotification do={ :do { :set SendNotification do={ :onerror Err {
:global SendNotification2; :global SendNotification2;
$SendNotification2 ({ origin=$0; subject=$1; message=$2; link=$3; silent=$4 }); $SendNotification2 ({ origin=$0; subject=$1; message=$2; link=$3; silent=$4 });
} on-error={ } do={
:global ExitError; $ExitError false $0; :global ExitError; $ExitError false $0 $Err;
} } } }
# send notification via NotificationFunctions - expects one array argument # send notification via NotificationFunctions - expects one array argument