From 902296e389113380fec4f2bf88c330c1702b48de Mon Sep 17 00:00:00 2001 From: Graza Date: Wed, 5 Feb 2025 08:30:43 +0000 Subject: [PATCH] refactor: ShowError/ShowWarn/ShowErrorWithMessage now print to stdout instead of stderr --- error_helpers/utils.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/error_helpers/utils.go b/error_helpers/utils.go index 06c8c9be..11e6e192 100644 --- a/error_helpers/utils.go +++ b/error_helpers/utils.go @@ -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 @@ -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 @@ -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 {