tadayosi opened a new issue #3029:
URL: https://github.com/apache/camel-k/issues/3029


   While closely examining the code of `kamel local` subcommands I found that 
they println errors instead of simply throwing them only in the `run` phase:
   https://github.com/apache/camel-k/blob/main/pkg/cmd/local_build.go#L47
   ```
                RunE: func(cmd *cobra.Command, args []string) error {
                        if err := options.validate(args); err != nil {
                                return err
                        }
                        if err := options.init(args); err != nil {
                                return err
                        }
                        if err := options.run(cmd, args); err != nil {
                                fmt.Println(err.Error())
                        }
                        if err := options.deinit(); err != nil {
                                return err
                        }
   ```
   https://github.com/apache/camel-k/blob/main/pkg/cmd/local_run.go#L47
   ```
                RunE: func(cmd *cobra.Command, args []string) error {
                        if err := options.validate(args); err != nil {
                                return err
                        }
                        if err := options.init(); err != nil {
                                return err
                        }
                        if err := options.run(cmd, args); err != nil {
                                fmt.Println(err.Error())
                        }
                        if err := options.deinit(); err != nil {
                                return err
                        }
   ```
   It causes inconsistency in how error messages are shown with the commands. 
Does anyone know why it's needed?  Can I simply change them to throw errors?
   
   @doru1004 Can you give us insights?


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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to