tracederrors

package
v0.265.0 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrTracedError = errors.New("asciichgolangpublic TracedError base")
View Source
var ErrTracedErrorEmptyString = errors.New("asciichgolangpublic TracedError empty string")
View Source
var ErrTracedErrorNil = errors.New("asciichgolangpublic TracedError nil")
View Source
var ErrTracedErrorNotImplemented = errors.New("asciichgolangpublic TracedError not implemented")

Functions

func AddErrorToUnwrapToTracedError

func AddErrorToUnwrapToTracedError(tracedError error, errorToAdd error) error

func IsEmptyStringError

func IsEmptyStringError(err error) (isEmptyStringError bool)

func IsNilError

func IsNilError(err error) (IsNilError bool)

func IsNotImplementedError

func IsNotImplementedError(err error) (isNotImplementedError bool)

func IsTracedError

func IsTracedError(err error) (isTracedError bool)

Returns true if given error 'err' is a TracedError, false otherwise.

func TracedError

func TracedError(errorMessageOrError interface{}) (tracedError error)

Create a new error with given error or error message. TracedErrors extends the error message by a human readable stack trace.

func TracedErrorEmptyString

func TracedErrorEmptyString(stringVarName string, errorToUnwrap ...error) (tracedError error)

func TracedErrorNil

func TracedErrorNil(nilVarName string) (tracedError error)

func TracedErrorNilf

func TracedErrorNilf(formatString string, args ...interface{}) (tracedError error)

func TracedErrorNotImplemented

func TracedErrorNotImplemented() (tracedError error)

func TracedErrorf

func TracedErrorf(formatString string, args ...interface{}) (tracedError error)

Create a new error with given error or error message. TracedErrors extends the error message by a human readable stack trace. Error wrapping using '%w' in format string is supported.

func UnwrapRecursive

func UnwrapRecursive(errorToUnwrap error) (errors []error)

Types

type TracedErrorType

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

func GetAsTracedError

func GetAsTracedError(errorToConvert error) (tracedError *TracedErrorType, err error)

func MustGetAsTracedError

func MustGetAsTracedError(errorToConvert error) (tracedError *TracedErrorType)

func NewTracedErrorType

func NewTracedErrorType() (t *TracedErrorType)

func (TracedErrorType) Error

func (t TracedErrorType) Error() (errorMessage string)

func (*TracedErrorType) GetErrorMessage

func (t *TracedErrorType) GetErrorMessage() (errorMessage string, err error)

func (*TracedErrorType) GetErrorsToUnwrap

func (t *TracedErrorType) GetErrorsToUnwrap() (errorsToUnwrap []error, err error)

func (*TracedErrorType) GetFormattedError

func (t *TracedErrorType) GetFormattedError() (formattedError error, err error)

func (*TracedErrorType) GetFunctionCalls

func (t *TracedErrorType) GetFunctionCalls() (functionCalls []string, err error)

func (*TracedErrorType) MustGetErrorMessage

func (t *TracedErrorType) MustGetErrorMessage() (errorMessage string)

func (*TracedErrorType) MustGetErrorsToUnwrap

func (t *TracedErrorType) MustGetErrorsToUnwrap() (errorsToUnwrap []error)

func (*TracedErrorType) MustGetFormattedError

func (t *TracedErrorType) MustGetFormattedError() (formattedError error)

func (*TracedErrorType) MustGetFunctionCalls

func (t *TracedErrorType) MustGetFunctionCalls() (functionCalls []string)

func (*TracedErrorType) MustSetErrorsToUnwrap

func (t *TracedErrorType) MustSetErrorsToUnwrap(errorsToUnwrap []error)

func (*TracedErrorType) MustSetFormattedError

func (t *TracedErrorType) MustSetFormattedError(formattedError error)

func (*TracedErrorType) MustSetFunctionCalls

func (t *TracedErrorType) MustSetFunctionCalls(functionCalls []string)

func (*TracedErrorType) SetErrorsToUnwrap

func (t *TracedErrorType) SetErrorsToUnwrap(errorsToUnwrap []error) (err error)

func (*TracedErrorType) SetFormattedError

func (t *TracedErrorType) SetFormattedError(formattedError error) (err error)

func (*TracedErrorType) SetFunctionCalls

func (t *TracedErrorType) SetFunctionCalls(functionCalls []string) (err error)

func (TracedErrorType) Unwrap

func (t TracedErrorType) Unwrap() (errors []error)

Jump to

Keyboard shortcuts

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