burrito

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2022 License: MIT Imports: 6 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PrintStackTrace = false

Functions

func PassError

func PassError(err error) error

PassError adds stack trace to an error without any additional text.

func PassErrorHandlerError

func PassErrorHandlerError(mainErr, handlerErr error, connectorText string) error

PassErrorHandlerError combines mainErr and handlerError similar to WrapErrorHandlerError, but it doesn't provide any additional text (analogous to PassError).

func WrapError

func WrapError(err error, text string) error

WrapError wraps an error with a stack trace and adds additional text information.

func WrapErrorHandlerError

func WrapErrorHandlerError(
	mainErr, handlerErr error, connectorText, errorHandlerText string,
) error

WrapErrorHandlerError combines two errors into one. The first error is an error that occurred during the main operation. The second error is an error that occurred during error handling. Errors are combined using connectorText. Additional text can be added to the handler error message using errorHandlerText.

func WrapErrorf

func WrapErrorf(err error, text string, args ...interface{}) error

WrapErrorf wraps an error with a stack trace and adds additional formatted text information.

func WrappedError

func WrappedError(text string) error

WrappedError creates an error with a stack trace from text.

func WrappedErrorf

func WrappedErrorf(text string, args ...interface{}) error

WrappedErrorf creates an error with a stack trace from formatted text.

Types

type Error

type Error struct {
	Err            error
	Message        *string
	File           string
	Line           int
	FuncName       string
	ShowStackTrace *bool
	Tags           []string
}

func (*Error) AddTag

func (r *Error) AddTag(tag string)

func (*Error) Error

func (r *Error) Error() string

func (*Error) ForceStackTrace

func (r *Error) ForceStackTrace(enabled bool)

func (*Error) HasTag

func (r *Error) HasTag(tag string) bool

Jump to

Keyboard shortcuts

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