camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: @ExchangeException does not always bind to the caught Exception
Date Tue, 19 May 2009 07:16:30 GMT
Hi Joe

I got it. I have reproduced an unit test demonstrating this issue.

I have created a ticket to track it:
https://issues.apache.org/activemq/browse/CAMEL-1626

Will commit a fix shortly.


On Tue, May 19, 2009 at 6:51 AM, Claus Ibsen <claus.ibsen@gmail.com> wrote:
> 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 <josephgottman@comcast.net> 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
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Mime
View raw message