You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by lb...@apache.org on 2022/05/06 07:02:00 UTC

[camel-k-runtime] branch main updated: Improve error message during ErrorHander building validation #820

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

lburgazzoli pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git


The following commit(s) were added to refs/heads/main by this push:
     new bb301972 Improve error message during ErrorHander building validation #820
bb301972 is described below

commit bb3019722e98977bdd6fb06e8bcdaac2890fc702
Author: Luca Burgazzoli <lb...@gmail.com>
AuthorDate: Thu May 5 22:35:19 2022 +0200

    Improve error message during ErrorHander building validation #820
---
 .../main/java/org/apache/camel/k/support/SourcesSupport.java | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/camel-k-core/support/src/main/java/org/apache/camel/k/support/SourcesSupport.java b/camel-k-core/support/src/main/java/org/apache/camel/k/support/SourcesSupport.java
index 853887d9..2fc4326b 100644
--- a/camel-k-core/support/src/main/java/org/apache/camel/k/support/SourcesSupport.java
+++ b/camel-k-core/support/src/main/java/org/apache/camel/k/support/SourcesSupport.java
@@ -110,10 +110,12 @@ public final class SourcesSupport {
                         List<RouteTemplateDefinition> templates = builder.getRouteTemplateCollection().getRouteTemplates();
 
                         if (routes.size() != 1) {
-                            throw new IllegalArgumentException("There should be a single route definition, got " + routes.size());
+                            throw new IllegalArgumentException(
+                                "There should be a single route definition when configuring route templates, got " + routes.size());
                         }
                         if (!templates.isEmpty()) {
-                            throw new IllegalArgumentException("There should not be any template, got " + templates.size());
+                            throw new IllegalArgumentException(
+                                "There should not be any template definition when configuring route templates, got " + templates.size());
                         }
 
                         // create a new template from the source
@@ -140,10 +142,12 @@ public final class SourcesSupport {
                         List<RouteTemplateDefinition> templates = builder.getRouteTemplateCollection().getRouteTemplates();
 
                         if (!routes.isEmpty()) {
-                            throw new IllegalArgumentException("There should be no route definition, got " + routes.size());
+                            throw new IllegalArgumentException(
+                                "There should be no route definition when configuring error handler, got " + routes.size());
                         }
                         if (!templates.isEmpty()) {
-                            throw new IllegalArgumentException("There should not be any template, got " + templates.size());
+                            throw new IllegalArgumentException(
+                                "There should not be any template definition when configuring error handler, got " + templates.size());
                         }
 
                         if (hasErrorHandlerBuilder(builder)) {