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

This commit is contained in:
Christian Hesse 2025-05-06 09:45:14 +02:00
parent 862830b341
commit 9d845d40f0

View file

@ -17,7 +17,7 @@
:global SendGotify2; :global SendGotify2;
# flush Gotify queue # flush Gotify queue
:set FlushGotifyQueue do={ :do { :set FlushGotifyQueue do={ :onerror Err {
:global GotifyQueue; :global GotifyQueue;
:global IsFullyConnected; :global IsFullyConnected;
@ -53,8 +53,8 @@
/system/scheduler/remove [ find where name="_FlushGotifyQueue" ]; /system/scheduler/remove [ find where name="_FlushGotifyQueue" ];
:set GotifyQueue; :set GotifyQueue;
} }
} on-error={ } do={
:global ExitError; $ExitError false $0; :global ExitError; $ExitError false $0 $Err;
} } } }
# send notification via Gotify - expects one array argument # send notification via Gotify - expects one array argument
@ -121,12 +121,12 @@
} }
# send notification via Gotify - expects at least two string arguments # send notification via Gotify - expects at least two string arguments
:set SendGotify do={ :do { :set SendGotify do={ :onerror Err {
:global SendGotify2; :global SendGotify2;
$SendGotify2 ({ origin=$0; subject=$1; message=$2; link=$3; silent=$4 }); $SendGotify2 ({ 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 Gotify - expects one array argument # send notification via Gotify - expects one array argument