error_helpers

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 22, 2025 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Copied from pipe-fittings/error_helpers.go. We handle cancellation differently: cancellations are a user choice, so we don't throw an error (normalized to "execution cancelled").

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FailOnError

func FailOnError(err error)

func FailOnErrorWithMessage

func FailOnErrorWithMessage(err error, message string)

func GetWarningOutputStream

func GetWarningOutputStream() io.Writer

func IsCancelledError

func IsCancelledError(err error) bool

func IsMachineReadableOutput

func IsMachineReadableOutput() bool

IsMachineReadableOutput checks if the current output format is machine readable (CSV or JSON)

func PrefixError

func PrefixError(err error, prefix string) error

func ShowError

func ShowError(ctx context.Context, err error)

func ShowErrorWithMessage

func ShowErrorWithMessage(ctx context.Context, err error, message string)

ShowErrorWithMessage displays the given error nicely with the given message

func ShowInfo

func ShowInfo(info string)

ShowInfo prints a non-critical info message to the appropriate output stream. Behaves like ShowWarning but with a calmer label (Note) to avoid alarming users for successful outcomes or informational messages.

func ShowWarning

func ShowWarning(warning string)

func TransformErrorToTailpipe

func TransformErrorToTailpipe(err error) error

TransformErrorToTailpipe removes the pq: and rpc error prefixes along with all the unnecessary information that comes from the drivers and libraries

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL