Improve Sender.java to use nested exceptions
The Saxon XSLT and XQuery processor, developed by Saxonica
Brought to you by:
mhkay
In Sender.java, nested exceptions are not used. This means that the exception that caused the problem is tossed out, making diagnosis difficult.
This patch improves the exception handling in Sender.java so that it propagates the original exception as a nested exception.
There may be other places in Saxon that need this improvement, but Sender.java is the one that was affecting me.
Anonymous
Thanks, I'll incorporate these. There's one I'm not quite sure about: the common case of an XML parser error around line 416. I'm not sure it's right to both include the nested exception and append its message. The standard error listener takes care of this by only appending the message from the nested exception if it's not already there in the primary message, but it still feels questionable.
"I'm not sure it's right to both include the nested exception and append its message."
If it were me, I would remove the appending of the message and leave the nesting of the exception.