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

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

View file

@ -35,7 +35,7 @@
} }
# flush e-mail queue # flush e-mail queue
:set FlushEmailQueue do={ :do { :set FlushEmailQueue do={ :onerror Err {
:global EmailQueue; :global EmailQueue;
:global EitherOr; :global EitherOr;
@ -135,8 +135,8 @@
/system/scheduler/set interval=(($SchedVal->"run-count") . "m") \ /system/scheduler/set interval=(($SchedVal->"run-count") . "m") \
comment="Waiting for retry..." $Scheduler; comment="Waiting for retry..." $Scheduler;
} on-error={ } do={
:global ExitError; $ExitError false $0; :global ExitError; $ExitError false $0 $Err;
} } } }
# generate filter for log-forward # generate filter for log-forward
@ -248,12 +248,12 @@
} }
# send notification via e-mail - expects at least two string arguments # send notification via e-mail - expects at least two string arguments
:set SendEMail do={ :do { :set SendEMail do={ :onerror Err {
:global SendEMail2; :global SendEMail2;
$SendEMail2 ({ origin=$0; subject=$1; message=$2; link=$3 }); $SendEMail2 ({ origin=$0; subject=$1; message=$2; link=$3 });
} on-error={ } do={
:global ExitError; $ExitError false $0; :global ExitError; $ExitError false $0 $Err;
} } } }
# send notification via e-mail - expects one array argument # send notification via e-mail - expects one array argument