You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by as...@apache.org on 2022/02/01 12:48:33 UTC

[camel-k] branch release-1.8.x updated: fix(cli): Kamel CLI zero-code exists when trait properties validation fails

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

astefanutti pushed a commit to branch release-1.8.x
in repository https://gitbox.apache.org/repos/asf/camel-k.git


The following commit(s) were added to refs/heads/release-1.8.x by this push:
     new 7405849  fix(cli): Kamel CLI zero-code exists when trait properties validation fails
7405849 is described below

commit 74058492d6aa02bcaf0df843d7bbc28a069a116a
Author: Antonin Stefanutti <an...@stefanutti.fr>
AuthorDate: Mon Jan 31 09:35:51 2022 +0100

    fix(cli): Kamel CLI zero-code exists when trait properties validation fails
---
 pkg/cmd/run.go | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/pkg/cmd/run.go b/pkg/cmd/run.go
index 4721fef..516099d 100644
--- a/pkg/cmd/run.go
+++ b/pkg/cmd/run.go
@@ -297,8 +297,7 @@ func (o *runCmdOptions) run(cmd *cobra.Command, args []string) error {
 			prefix = prefix[0:strings.Index(prefix, "[")]
 		}
 		if !util.StringSliceExists(tp, prefix) {
-			fmt.Printf("Error: %s is not a valid trait property\n", t)
-			return nil
+			return fmt.Errorf("%s is not a valid trait property", t)
 		}
 	}