You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2020/05/06 17:51:00 UTC

[jira] [Comment Edited] (CAMEL-15020) Improve FAQ: Why is the exception null when I use onException?

    [ https://issues.apache.org/jira/browse/CAMEL-15020?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17101048#comment-17101048 ] 

Claus Ibsen edited comment on CAMEL-15020 at 5/6/20, 5:50 PM:
--------------------------------------------------------------

Just because it says handled(true) does not imply that when you dont do this that its not null. But I agree it can be confusing so lets update the FAQ.

Thanks for reporting.


was (Author: davsclaus):
Just because it says handled(true) does not imply that when you dont do this that its not null.

> Improve FAQ: Why is the exception null when I use onException?
> --------------------------------------------------------------
>
>                 Key: CAMEL-15020
>                 URL: https://issues.apache.org/jira/browse/CAMEL-15020
>             Project: Camel
>          Issue Type: Improvement
>          Components: documentation
>            Reporter: Thomas Küstermann
>            Priority: Trivial
>
> The FAQ article [Why is the exception null when I use onException?|https://camel.apache.org/manual/latest/faq/why-is-the-exception-null-when-i-use-onexception.html] states that {{exchange.getException()}} returns {{null}} if {{onException()}} is used in conjunction with {{handled(true)}}.
> Whether it's handled or not, {{exchange.getException()}} return always {{null}} since the default error handling mechanism clears the exception already:
> {code:java|title=RedeliveryErrorHandler.deliverToFailureProcessor() - Camel 2.25.0}
> // we did not success with the redelivery so now we let the failure processor handle it
> // clear exception as we let the failure processor handle it
> exchange.setException(null);
> {code}
> I'm fairly new too Camel error handling, it would've been helpful in advance to know it.
> References:
> * [Exception in Exchange is null|https://camel.465427.n5.nabble.com/Exception-in-Exchange-is-null-td5717324.html]
> * [Apache Camel: exchange.getException() vs CamelExceptionCaught property|https://stackoverflow.com/q/37422568/5006866]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)