1
0
Fork 0

Emesary; handle fatal errors during a recipient receive.

- the recipient will be removed from the transmitter and appropriate error messages printed.

Contributed by Nikolai V. Chr.
This commit is contained in:
Richard Harrison 2018-11-07 01:53:06 +01:00
parent 8e45e86f9c
commit 8841f77cfd

View file

@ -107,7 +107,17 @@ var Transmitter =
{ {
if (recipient.RecipientActive) if (recipient.RecipientActive)
{ {
var rstat = recipient.Receive(message); var rstat = nil;
call(func {rstat = recipient.Receive(message);},nil,nil,nil,var err = []);
if (size(err)){
foreach(var line; err) {
print(line);
}
print("Recipient ",recipient.Ident, " has been removed from transmitter (", me.Ident, ") because of the above error");
me.DeRegister(recipient);
return Transmitter.ReceiptStatus_Abort;#need to break the foreach due to having modified what its iterating over.
}
if(rstat == Transmitter.ReceiptStatus_Fail) if(rstat == Transmitter.ReceiptStatus_Fail)
{ {