Croway opened a new pull request, #30086: URL: https://github.com/apache/camel/pull/30086
Follow-up of #29562. The section "Error handling across routes" says that the error handler of the called route deals with a failure in that route, so the `onException` of the calling route does not run for it. That is not true for an exception that escapes a `doTry` block of the called route. The route error handler is not in use for the steps of a `doTry ... doCatch ... doFinally` block (`ProcessorDefinitionHelper.shouldWrapInErrorHandler`), so the exception leaves the called route without going through its error handler, and the error handler of the calling route deals with it. - `error-handler.adoc`: the section now says that such an exception (not caught by any `doCatch`, or thrown from a `doCatch` or `doFinally` block) is not dealt with by the error handler of the called route. The `onException` of the calling route runs for it (also one defined for all the routes of its `RouteBuilder`), and a redelivery of the calling route calls the whole called route again. With the inline routes of the Rest DSL (the default), the inlined `direct` route is part of the REST route, so such an exception fails the exchange and no `onException` runs for it. - `exception-clause.adoc`: the across-routes paragraph names the same case. - `doTry-eip.adoc` "Exceptions that are not caught" (and its catalog copy), and the IMPORTANT box of `try-catch-finally.adoc`: when the route was called from another route, the error handler of the calling route deals with an exception that escapes the block. - `ErrorHandlingAcrossRoutesTest`: the escape case for the three ways out of the `doTry` (the `onException` of the called route does not run, the one of the calling route runs once after its 2 redeliveries, and the called route runs 3 times); the control, with the same exception thrown after the `doTry` (the `onException` of the called route deals with it, the caller's does not run); and the REST case with and without inline routes. - Already pinned for the calling route: `DoCatchFailureHandledMarkTest.failureOfTheDoCatchGoesToTheDeadLetterChannelOfTheOuterRoute` and `DoCatchRedeliveryOverTest.callingRouteGetsItsOwnRedeliveriesWhenTheDoCatchThrows`. _Claude Code on behalf of Federico Mariani_ -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
