You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "Robert J. Liguori" <ca...@gliesian.com> on 2011/09/08 19:01:35 UTC
How do I get the exception information that is caught in Spring DSLroutes?
How do I get the exception information that is caught in Spring DSL
routes?
For, example, when I'm using the validation component, the exception
routes the invalid XML to the specified endpoint:
...
<doCatch>
<exception>org.apache.camel.ValidationException</exception>
<to uri="mock:invalid"/>
</doCatch>
...
That's cool, but I want to see what the exception was... how do I get
to it? Note that I'm new to Spring and Camel.
Thanks,
Robert
Re: How do I get the exception information that is caught in Spring
DSL routes?
Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Sep 8, 2011 at 7:01 PM, Robert J. Liguori <ca...@gliesian.com> wrote:
> How do I get the exception information that is caught in Spring DSL
> routes?
>
> For, example, when I'm using the validation component, the exception
> routes the invalid XML to the specified endpoint:
>
> ...
> <doCatch>
>
> <exception>org.apache.camel.ValidationException</exception>
> <to uri="mock:invalid"/>
> </doCatch>
> ...
>
> That's cool, but I want to see what the exception was... how do I get
> to it? Note that I'm new to Spring and Camel.
>
The exception is stored as a property on the Exchange.
In java code its like this:
Exception cause = exchange.getProperty(Exchange.EXCEPTION_CAUGHT,
Exception.class);
> Thanks,
> Robert
>
--
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/