You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2021/02/15 09:44:32 UTC

[GitHub] [camel] davsclaus commented on a change in pull request #5088: core: set the error handler to RouteDefinition

davsclaus commented on a change in pull request #5088:
URL: https://github.com/apache/camel/pull/5088#discussion_r576060177



##########
File path: core/camel-core-model/src/main/java/org/apache/camel/model/RoutesDefinition.java
##########
@@ -192,9 +192,18 @@ public RouteDefinition from(EndpointConsumerBuilder endpoint) {
      * @return       the builder
      */
     public RouteDefinition route(RouteDefinition route) {
+        // must set the error handler if not already set on the route
+        if (route.getErrorHandlerFactory() != null && route.getErrorHandlerRef() != null) {
+            ErrorHandlerFactory handler = getErrorHandlerFactory();
+            if (handler != null) {
+                route.setErrorHandlerFactory(handler);
+            }
+        }

Review comment:
       Ah yeah that API is not really for end users, as that would mean they build those model classes outside the DSL and then take that model (which is a route) and add to a route (doesnt make so much sense).
   
   We should possibly mark in the javadoc that this is only for internal usage. And maybe come up with a different name, and deprecate the old name.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org