Hi Joe Which version of Camel are you using precisely?
I do think that we can improve @ExchangeException to be able to find the exception you want in the exception hierarchy. As for instance on trunk you can do: exchange.getException(JaxbException.class) and it will find that exception for you in the list of wrapped caused exceptions. So the same feature should apply for @ExchangeException. On Tue, May 19, 2009 at 2:21 AM, Joe Gottman <[email protected]> wrote: > > 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. > > -- Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus
