I have a Bean method
public String handleJaxbError( @ExchangeException JaxbException e)
that is written to handle a thrown JaxbException and is only called inside
a doCatch(JaxbException) clause. However, when the parameter e is of type
JaxbException, the value of e when the method is executed is null. I have
to write the function as
public String handleJaxbError(@ExchangeException Exception
e)
to get the caught Exception in the e variable. The trouble is that the
Exception that was thrown was not a JaxbException. It was an IOException
that returned a JaxbException when e.getCause() was called. Even so, since
the doCatch(JaxbException.class) clause did catch this exception, it seems
to me that the JaxbException should bind to the @ExchangeException
annotation. Or alternatively, we could have a @CaughtException annotation
that binds to the exception that was caught, and have @ExchangeException
continue to bind to the outermost Exception.
--
View this message in context:
http://www.nabble.com/%40ExchangeException-does-not-always-bind-to-the-caught-Exception-tp23607585p23607585.html
Sent from the Camel Development mailing list archive at Nabble.com.