From 8841f77cfd38a8a37f6e37ca3aabe308136c4e53 Mon Sep 17 00:00:00 2001 From: Richard Harrison Date: Wed, 7 Nov 2018 01:53:06 +0100 Subject: [PATCH] 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. --- Nasal/emesary.nas | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Nasal/emesary.nas b/Nasal/emesary.nas index 1ba6f7bfa..0b23293b3 100644 --- a/Nasal/emesary.nas +++ b/Nasal/emesary.nas @@ -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) {