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:
parent
8e45e86f9c
commit
8841f77cfd
1 changed files with 11 additions and 1 deletions
|
@ -107,7 +107,17 @@ var Transmitter =
|
|||
{
|
||||
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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue