Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-15020

Improve FAQ: Why is the exception null when I use onException?

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Trivial
    • Resolution: Fixed
    • None
    • 3.3.0
    • documentation
    • None
    • Unknown

    Description

      The FAQ article Why is the exception null when I use onException? 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:

      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);
      

      I'm fairly new too Camel error handling, it would've been helpful in advance to know it.

      References:

      Attachments

        Activity

          People

            davsclaus Claus Ibsen
            thokuest Thomas Küstermann
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: