Skip to content
New issue

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

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

Already on GitHub? # to your account

refactor: ShowError/ShowWarn/ShowErrorWithMessage now print to stdout instead of stderr #634

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
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
6 changes: 3 additions & 3 deletions error_helpers/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func ShowError(ctx context.Context, err error) {
}
err = HandleCancelError(err)
statushooks.Done(ctx)
fmt.Fprintf(color.Error, "%s: %v\n", constants.ColoredErr, TransformErrorToSteampipe(err))
fmt.Fprintf(color.Output, "%s: %v\n", constants.ColoredErr, TransformErrorToSteampipe(err))
}

// ShowErrorWithMessage displays the given error nicely with the given message
Expand All @@ -56,7 +56,7 @@ func ShowErrorWithMessage(ctx context.Context, err error, message string) {
}
err = HandleCancelError(err)
statushooks.Done(ctx)
fmt.Fprintf(color.Error, "%s: %s - %v\n", constants.ColoredErr, message, TransformErrorToSteampipe(err))
fmt.Fprintf(color.Output, "%s: %s - %v\n", constants.ColoredErr, message, TransformErrorToSteampipe(err))
}

// TransformErrorToSteampipe removes the pq: and rpc error prefixes along
Expand Down Expand Up @@ -106,7 +106,7 @@ func ShowWarning(warning string) {
if len(warning) == 0 {
return
}
fmt.Fprintf(color.Error, "%s: %v\n", constants.ColoredWarn, warning)
fmt.Fprintf(color.Output, "%s: %v\n", constants.ColoredWarn, warning)
}

func CombineErrorsWithPrefix(prefix string, errors ...error) error {
Expand Down