You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by ritterda <da...@sap.com> on 2016/04/15 12:23:13 UTC

Catch-All for (Sub-) Route Exception Handling

Hello, 

I am analyzing the exception handling capabilities of Apache Camel (v2.16.x)
and was wondering whether it is possible to propagate exceptions from a
subroute (B; e.g., "from:direct") to the calling route (A; e.g.,
"to:direct") without setting ".errorHandler(noErrorHandler())".

A: from(..).onException(IOException.class)...process().to(direct:subroute);

B:
from(direct:subroute).*errorHandler(noErrorHandler())*.process(fails).to(..);

The noErrorHandler flag on a subroute level disables all error handlers
(e.g., global TransactionErrorHandler, DefaultErrorHandler). As a result the
exception is propagated to the calling route (A). As suggested in many
forums, this works fine, i.e., the exception is caught by the onException
clause for further processing. However, if error handlers are required, the
noErrorHandler cannot be set, which does not propagate the exception.

Do you know a way how to ensure the described behavior? Thank you in
advance.

Best Regards,
Daniel Ritter







--
View this message in context: http://camel.465427.n5.nabble.com/Catch-All-for-Sub-Route-Exception-Handling-tp5781154.html
Sent from the Camel - Users mailing list archive at Nabble.com.