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] [Resolved] (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:all-tabpanel ]

Claus Ibsen resolved CAMEL-15020.
---------------------------------
    Fix Version/s: 3.3.0
         Assignee: Claus Ibsen
       Resolution: Fixed

> 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
>            Assignee: Claus Ibsen
>            Priority: Trivial
>             Fix For: 3.3.0
>
>
> 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)