error_helpers

package
v0.18.0-dev.7 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2022 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MissingCloudTokenError = errors.New("Not authenticated for Steampipe Cloud.\nPlease run 'steampipe login' or setup a token.")

Functions

func CombineErrors

func CombineErrors(errors ...error) error

func CombineErrorsWithPrefix

func CombineErrorsWithPrefix(prefix string, errors ...error) error

func DecodePgError

func DecodePgError(err error) error

func DiagsToError

func DiagsToError(prefix string, diags tfdiags.Diagnostics) error

DiagsToError converts tfdiags diags into an error

func EnrichPreparedStatementError

func EnrichPreparedStatementError(err error, queryName string, creationError error, declRange *hcl.Range) error

EnrichPreparedStatementError checks if the given error is a prepared statement error and if so, add in the given query name be printed on the console

func FailOnError

func FailOnError(err error)

func FailOnErrorWithMessage

func FailOnErrorWithMessage(err error, message string)

func HandleCancelError

func HandleCancelError(err error) error

HandleCancelError modifies a context.Canceled error into a readable error that can be printed on the console

func HandleQueryTimeoutError

func HandleQueryTimeoutError(err error) error

func IsCancelledError

func IsCancelledError(err error) bool

func IsPreparedStatementDoesNotExistError

func IsPreparedStatementDoesNotExistError(err error) bool

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 ShowWarning

func ShowWarning(warning string)

func TransformErrorToSteampipe

func TransformErrorToSteampipe(err error) error

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

func WrapError

func WrapError(err error) error

func WrapPreparedStatementError

func WrapPreparedStatementError(err error) error

WrapPreparedStatementError modifies a context.Canceled error into a readable error that can be printed on the console

Types

type PreparedStatementError

type PreparedStatementError struct {
	// contains filtered or unexported fields
}

PreparedStatementError is an error type to wrap PreparedStatement errors

func NewPreparedStatementError

func NewPreparedStatementError(underlying error) *PreparedStatementError

func (*PreparedStatementError) Enrich

func (e *PreparedStatementError) Enrich(name string, err error, declRange *hcl.Range) *PreparedStatementError

func (*PreparedStatementError) Error

func (e *PreparedStatementError) Error() string

func (*PreparedStatementError) Is

func (e *PreparedStatementError) Is(err error) bool

Jump to

Keyboard shortcuts

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