mod/notification-ntfy: use :onerror for outer block

This commit is contained in:
Christian Hesse 2025-05-06 09:45:14 +02:00
parent d865deb8a8
commit e3a15cc6b8

View file

@ -16,7 +16,7 @@
:global SendNtfy2;
# flush ntfy queue
:set FlushNtfyQueue do={ :do {
:set FlushNtfyQueue do={ :onerror Err {
:global NtfyQueue;
:global IsFullyConnected;
@ -52,8 +52,8 @@
/system/scheduler/remove [ find where name="_FlushNtfyQueue" ];
:set NtfyQueue;
}
} on-error={
:global ExitError; $ExitError false $0;
} do={
:global ExitError; $ExitError false $0 $Err;
} }
# send notification via ntfy - expects one array argument
@ -143,12 +143,12 @@
}
# send notification via ntfy - expects at least two string arguments
:set SendNtfy do={ :do {
:set SendNtfy do={ :onerror Err {
:global SendNtfy2;
$SendNtfy2 ({ origin=$0; subject=$1; message=$2; link=$3; silent=$4 });
} on-error={
:global ExitError; $ExitError false $0;
} do={
:global ExitError; $ExitError false $0 $Err;
} }
# send notification via ntfy - expects one array argument