Skip to content

feat: add verbose error messaging #3053

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

Merged
merged 6 commits into from
Jul 20, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix not printing anything at all
  • Loading branch information
sreya committed Jul 13, 2022
commit 1d65a42ebb85fbd9e3fc0ea3be30113a2276fe1b
4 changes: 3 additions & 1 deletion cli/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,9 @@ func FormatCobraError(err error, cmd *cobra.Command) string {
_, _ = fmt.Fprintln(&output, httpErr.Friendly())
}

if cliflag.IsSetBool(cmd, varVerbose) {
// If the httpErr is nil then we just have a regular error in which
// case we want to print out what's happening.
if httpErr == nil || cliflag.IsSetBool(cmd, varVerbose) {
_, _ = fmt.Fprintln(&output, err.Error())
}

Expand Down