I believe the try/catch/finally DSL disables the normal Camel error handling ( 
http://camel.apache.org/try-catch-finally.html 
<http://camel.apache.org/try-catch-finally.html> ).  If I understand this 
correctly, the <handled> element in the snippet will not have any effect.

I don’t see you logging anything in the snippet, so I’m not sure where you’d 
expect the logging to occur - can you elaborate?

> On Mar 15, 2016, at 3:05 AM, artaxerxe <mapand...@gmail.com> wrote:
> 
> Hello,
> 
> I have the following camel route snippet:
> 
> <doCatch>
>    <exception>java.lang.Throwable</exception>
>    <handled>
>        <constant>false</constant>
>    </handled>
>    <setHeader headerName="some.header">
>        <constant>a value</constant>
>    </setHeader>
>    <setBody>
>        <simple>${exception.stacktrace}</simple>
>    </setBody>
>    <choice>
>        <when>
>            <simple>${header.some.check.value} == null</simple>
>            <wireTap uri="direct://some-direct"/>
>        </when>
>    </choice>
>    <setHeader headerName="another.header">
>        <constant>another value</constant>
>    </setHeader>
> </doCatch>
> 
> This is the doCatch snippet from a full route. I would expect that when an
> error is thrown on this route, the doCatch body to be executed and the error
> to be logged in log files. The problem is that the error isn't logged in
> files. Should this be the behavior? If yes, is there a default way in Camel
> to log this error, even if is caught (without using a custom processor)?
> 
> Thanks,
> Andrei Mura 
> 
> 
> 
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Handled-on-doTry-doCatch-not-Working-as-Expected-tp5779073.html
> Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to