On Feb 27, 2008, at 12:47 PM, Tobia Conforto wrote:
I'm still not sure if this is the right way to go about it. My
gode gets rid of errorListener.getThrowable() and I fear whoever
put it there in the first place did it for a reason. Whatever an
errorlistener is :-)
Oh I see what you mean now...
As I said before, xsltc does not *correctly* report exception: it does
not preserve the cause when reporting exception to the
javax.xml.transform.ErrorListener (implemented in Cocoon by
TraxErrorListener). But, instead of reporting it correctly in error
listener, it does supply cause exception in the exception caught by
TraxTransformer.
So best fix is to fix xsltc; sub optimal fix would be a hack along
these lines...
Throwable realEx = this.errorListener.getThrowable();
if (realEx instanceof TransformerException && realEx.getCause()
== null) {
// we got useless exception, throw it away
realEx = e;
}
As for unrolling exceptions, correct place for this is
ExceptionGenerator (NotifyingGenerator in 2.1 series), please do not
unroll in other places.
Vadim