errors

package
v0.199.0 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 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 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.

Types

type ErrorsService

type ErrorsService struct{}

func Errors

func Errors() (e *ErrorsService)

func NewErrorsService

func NewErrorsService() (e *ErrorsService)

func (*ErrorsService) AddErrorToUnwrapToTracedError

func (e *ErrorsService) AddErrorToUnwrapToTracedError(tracedError error, errorToAdd error) error

func (*ErrorsService) GetAsTracedError

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

func (ErrorsService) IsEmptyStringError

func (e ErrorsService) IsEmptyStringError(err error) (isEmptyStringError bool)

func (ErrorsService) IsNilError

func (e ErrorsService) IsNilError(err error) (IsNilError bool)

func (ErrorsService) IsNotImplementedError

func (e ErrorsService) IsNotImplementedError(err error) (isNotImplementedError bool)

func (ErrorsService) IsTracedError

func (e ErrorsService) IsTracedError(err error) (isTracedError bool)

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

func (*ErrorsService) MustGetAsTracedError

func (e *ErrorsService) MustGetAsTracedError(errorToConvert error) (tracedError *TracedErrorType)

func (ErrorsService) UnwrapRecursive

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

type TracedErrorType

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

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