camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Gottman <josephgott...@comcast.net>
Subject @ExchangeException does not always bind to the caught Exception
Date Tue, 19 May 2009 00:21:55 GMT

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.


Mime
View raw message