Skip to content

Commit

Permalink
refactor: ShowError/ShowWarn/ShowErrorWithMessage now print to stdout…
Browse files Browse the repository at this point in the history
… instead of stderr
  • Loading branch information
graza-io committed Feb 5, 2025
1 parent 691e6fd commit 902296e
Showing 1 changed file with 3 additions and 3 deletions.
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

0 comments on commit 902296e

Please # to comment.