Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hotfix: fix double error message prints #317

Merged
merged 1 commit into from
Apr 8, 2021
Merged

Conversation

hbagdi
Copy link
Member

@hbagdi hbagdi commented Apr 8, 2021

This incorrect change was introduced in 4717d53.

This incorrect change was introduced in 4717d53.
@hbagdi hbagdi requested a review from a team as a code owner April 8, 2021 13:41
@@ -41,8 +41,12 @@ It can be used to export, import or sync entities to Kong.`,
// Execute adds all child commands to the root command and sets
// sflags appropriately.
// This is called by main.main(). It only needs to happen once to the rootCmd.
func Execute() error {
return rootCmd.Execute()
func Execute() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you consider setting cobra.Command's SilenceErrors to true instead?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did. I reverted to match the past to avoid further new surprises.

Copy link
Contributor

@mflendrich mflendrich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My preference is to go with return err and suppressing error display on the cobra level, but I understand your point and therefore won't block this PR.

@hbagdi hbagdi merged commit b6e63f4 into main Apr 8, 2021
@hbagdi hbagdi deleted the hotfix/double-error branch April 8, 2021 21:06
rainest pushed a commit that referenced this pull request Apr 21, 2021
This incorrect change was introduced in 4717d53.
AntoineJac pushed a commit that referenced this pull request Jan 23, 2024
This incorrect change was introduced in 598f214.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants