catch (Exception ex) {
chain.triggerAfterSendCompletion(message, this, sent, ex);
if (ex instanceof MessagingException) {
throw (MessagingException) ex;
}
throw new MessageDeliveryException(message,"Failed to send message to " + this, ex);
}
catch (Error ex) {
MessageDeliveryException ex2 =
new MessageDeliveryException(message, "Failed to send message to " + this, ex);
chain.triggerAfterSendCompletion(message, this, sent, ex2);
throw ex2;
}
}