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

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

View file

@ -19,7 +19,7 @@
:global SetupMatrixJoinRoom; :global SetupMatrixJoinRoom;
# flush Matrix queue # flush Matrix queue
:set FlushMatrixQueue do={ :do { :set FlushMatrixQueue do={ :onerror Err {
:global MatrixQueue; :global MatrixQueue;
:global IsFullyConnected; :global IsFullyConnected;
@ -58,8 +58,8 @@
/system/scheduler/remove [ find where name="_FlushMatrixQueue" ]; /system/scheduler/remove [ find where name="_FlushMatrixQueue" ];
:set MatrixQueue; :set MatrixQueue;
} }
} on-error={ } do={
:global ExitError; $ExitError false $0; :global ExitError; $ExitError false $0 $Err;
} } } }
# send notification via Matrix - expects one array argument # send notification via Matrix - expects one array argument
@ -167,12 +167,12 @@
} }
# send notification via Matrix - expects at least two string arguments # send notification via Matrix - expects at least two string arguments
:set SendMatrix do={ :do { :set SendMatrix do={ :onerror Err {
:global SendMatrix2; :global SendMatrix2;
$SendMatrix2 ({ origin=$0; subject=$1; message=$2; link=$3 }); $SendMatrix2 ({ 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 Matrix - expects one array argument # send notification via Matrix - expects one array argument