This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 2b9a2ef1eaab641c04a26779a659c77f848c14a5
Author: Claus Ibsen <claus.ib...@gmail.com>
AuthorDate: Tue Sep 17 08:18:52 2019 +0200

    Revert "[CAMEL-13912] Remove access to the route when reifying the error 
handlers"
    
    This reverts commit ee5b49fa1a327bcee09fae67f456c3c6ef7cc064.
---
 .../camel/reifier/errorhandler/ErrorHandlerReifier.java       | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git 
a/core/camel-core/src/main/java/org/apache/camel/reifier/errorhandler/ErrorHandlerReifier.java
 
b/core/camel-core/src/main/java/org/apache/camel/reifier/errorhandler/ErrorHandlerReifier.java
index 48a853e..2a9b25c 100644
--- 
a/core/camel-core/src/main/java/org/apache/camel/reifier/errorhandler/ErrorHandlerReifier.java
+++ 
b/core/camel-core/src/main/java/org/apache/camel/reifier/errorhandler/ErrorHandlerReifier.java
@@ -162,7 +162,16 @@ public abstract class ErrorHandlerReifier<T extends 
ErrorHandlerBuilderSupport>
         // so we should use that one
         if (!isErrorHandlerFactoryConfigured(ref)) {
             // see if there has been configured a route builder on the route
-            answer = routeContext.getErrorHandlerFactory();
+            RouteDefinition route = (RouteDefinition)routeContext.getRoute();
+            answer = route.getErrorHandlerFactory();
+            if (answer == null && route.getErrorHandlerRef() != null) {
+                answer = routeContext.lookup(route.getErrorHandlerRef(), 
ErrorHandlerBuilder.class);
+            }
+            if (answer == null) {
+                // fallback to the default error handler if none configured on
+                // the route
+                answer = new DefaultErrorHandlerBuilder();
+            }
             // check if its also a ref with no error handler configuration like
             // me
             if (answer instanceof ErrorHandlerBuilderRef) {

Reply via email to