Skip to content

cmd: print the error before exiting non-zero#77

Merged
tamalsaha merged 1 commit into
masterfrom
fix/main-print-error
Jun 6, 2026
Merged

cmd: print the error before exiting non-zero#77
tamalsaha merged 1 commit into
masterfrom
fix/main-print-error

Conversation

@tamalsaha

Copy link
Copy Markdown
Contributor

Summary

`main` swallowed the error from `cmds.Execute()` and exited 1 with no hint. Whatever cobra had silenced (validation issues, mis-typed flags) was lost. Print it to stderr first so operators can debug startup failures.

Test plan

  • `go build ./...`
  • Run with a bad flag and confirm the error is printed before exit

main swallowed the error returned by cmds.Execute and exited 1 with no
hint about what went wrong. Whatever cobra had silenced (validation
issues, mis-typed flags) was lost. Print it to stderr first.

Signed-off-by: Tamal Saha <tamal@appscode.com>
@tamalsaha tamalsaha merged commit 9da75f4 into master Jun 6, 2026
4 checks passed
@tamalsaha tamalsaha deleted the fix/main-print-error branch June 6, 2026 15:47
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.

1 participant