errors

package
v2.0.0-...-98cc131 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

//nolint: errorlint // this is the new As method, also handling error lists

Index

Constants

View Source
const (
	KIND_FUNCTION      = "function"
	KIND_SCHEMAVERSION = "schema version"
	KIND_COMPONENT     = "component"
	KIND_ACCESSMETHOD  = "access method"
	KIND_OBJECTTYPE    = "object type"
)

Variables

View Source
var (
	New    = errors.New
	Unwrap = errors.Unwrap
)

Functions

func As

func As(err error, target any) bool

func ErrAlreadyExists

func ErrAlreadyExists(spec ...string) error

func ErrAlreadyExistsWrap

func ErrAlreadyExistsWrap(err error, spec ...string) error

func ErrClosed

func ErrClosed(spec ...string) error

func ErrInvalid

func ErrInvalid(spec ...string) error

func ErrInvalidWrap

func ErrInvalidWrap(err error, spec ...string) error

func ErrNotFound

func ErrNotFound(spec ...string) error

func ErrNotFoundWrap

func ErrNotFoundWrap(err error, spec ...string) error

func ErrNotImplemented

func ErrNotImplemented(spec ...string) error

func ErrNotSupported

func ErrNotSupported(spec ...string) error

func ErrReadOnly

func ErrReadOnly(spec ...string) error

func ErrRecusion

func ErrRecusion(kind string, elem interface{}, hist interface{}) error

ErrRecusion describes a resursion errors caused by a dedicated element with an element history.

func ErrRecusionWrap

func ErrRecusionWrap(err error, kind string, elem interface{}, hist interface{}) error

func ErrStillInUse

func ErrStillInUse(spec ...string) error

func ErrStillInUseWrap

func ErrStillInUseWrap(err error, spec ...string) error

func ErrUnknown

func ErrUnknown(spec ...string) error

func Is

func Is(err error, target error) bool

func IsA

func IsA(err error, target error) bool

func IsErrAlreadyExists

func IsErrAlreadyExists(err error) bool

func IsErrAlreadyExistsKind

func IsErrAlreadyExistsKind(err error, kind string) bool

func IsErrClosed

func IsErrClosed(err error) bool

func IsErrClosedKind

func IsErrClosedKind(err error, kind string) bool

func IsErrInvalid

func IsErrInvalid(err error) bool

func IsErrInvalidKind

func IsErrInvalidKind(err error, kind string) bool

func IsErrNotFound

func IsErrNotFound(err error) bool

func IsErrNotFoundKind

func IsErrNotFoundKind(err error, kind string) bool

func IsErrNotImplemented

func IsErrNotImplemented(err error) bool

func IsErrNotImplementedKind

func IsErrNotImplementedKind(err error, kind string) bool

func IsErrNotSupported

func IsErrNotSupported(err error) bool

func IsErrNotSupportedKind

func IsErrNotSupportedKind(err error, kind string) bool

func IsErrReadOnly

func IsErrReadOnly(err error) bool

func IsErrReadOnlyKind

func IsErrReadOnlyKind(err error, kind string) bool

func IsErrRecursionKind

func IsErrRecursionKind(err error, kind string) bool

func IsErrRecusion

func IsErrRecusion(err error) bool

func IsErrStillInUse

func IsErrStillInUse(err error) bool

func IsErrStillInUseKind

func IsErrStillInUseKind(err error, kind string) bool

func IsErrUnknown

func IsErrUnknown(err error) bool

func IsErrUnknownKind

func IsErrUnknownKind(err error, kind string) bool

func IsRetryable

func IsRetryable(err error) bool

IsRetryable checks whether a retry should be performed for a failed operation.

func Join

func Join(errs ...error) error

Join combines any number of errors to a single error. If no or only nil errors are given nil is returned.

func NewEf

func NewEf(cause error, msg string, args ...interface{}) error

NewEf provides an arror with an optional cause.

func Newf

func Newf(msg string, args ...interface{}) error

func PropagateError

func PropagateError(errp *error, f ErrorFunction)

PropagateError propagates a deferred error to the named return value whose address has to be passed as argument.

func PropagateErrorf

func PropagateErrorf(errp *error, f ErrorFunction, msg string, args ...interface{})

PropagateErrorf propagates an optional deferred error to the named return value whose address has to be passed as argument. All errors, including the original one, are wrapped by the given context.

func ToInterfaceSlice

func ToInterfaceSlice(list interface{}) []interface{}

func Wrap

func Wrap(err error, args ...interface{}) error

func Wrapf

func Wrapf(err error, msg string, args ...interface{}) error

Types

type AlreadyExistsError

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

func (*AlreadyExistsError) Ctx

func (e *AlreadyExistsError) Ctx() string

func (*AlreadyExistsError) CtxKind

func (e *AlreadyExistsError) CtxKind() string

func (*AlreadyExistsError) Elem

func (e *AlreadyExistsError) Elem() *string

func (*AlreadyExistsError) Error

func (e *AlreadyExistsError) Error() string

func (*AlreadyExistsError) Kind

func (e *AlreadyExistsError) Kind() string

func (*AlreadyExistsError) SetKind

func (e *AlreadyExistsError) SetKind(kind string)

func (*AlreadyExistsError) Unwrap

func (e *AlreadyExistsError) Unwrap() error

type ClosedError

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

func (*ClosedError) Ctx

func (e *ClosedError) Ctx() string

func (*ClosedError) CtxKind

func (e *ClosedError) CtxKind() string

func (*ClosedError) Elem

func (e *ClosedError) Elem() *string

func (*ClosedError) Error

func (e *ClosedError) Error() string

func (*ClosedError) Kind

func (e *ClosedError) Kind() string

func (*ClosedError) SetKind

func (e *ClosedError) SetKind(kind string)

func (*ClosedError) Unwrap

func (e *ClosedError) Unwrap() error

type ErrorFormatter

type ErrorFormatter interface {
	Format(kind string, elem *string, ctxkind string, ctx string) string
}

func NewDefaultFormatter

func NewDefaultFormatter(verb, msg, preposition string) ErrorFormatter

type ErrorFunction

type ErrorFunction func() error

type ErrorList

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

ErrorList is an error type with erros in it.

func ErrList

func ErrList(args ...interface{}) *ErrorList

func ErrListf

func ErrListf(msg string, args ...interface{}) *ErrorList

func (*ErrorList) Add

func (l *ErrorList) Add(errs ...error) *ErrorList

func (*ErrorList) Addf

func (l *ErrorList) Addf(writer io.Writer, err error, msg string, args ...interface{}) error

func (*ErrorList) Clear

func (l *ErrorList) Clear()

func (*ErrorList) Entries

func (l *ErrorList) Entries() []error

func (*ErrorList) Error

func (l *ErrorList) Error() string

func (*ErrorList) Len

func (l *ErrorList) Len() int

func (*ErrorList) Result

func (l *ErrorList) Result() error

type InvalidError

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

func (*InvalidError) Ctx

func (e *InvalidError) Ctx() string

func (*InvalidError) CtxKind

func (e *InvalidError) CtxKind() string

func (*InvalidError) Elem

func (e *InvalidError) Elem() *string

func (*InvalidError) Error

func (e *InvalidError) Error() string

func (*InvalidError) Kind

func (e *InvalidError) Kind() string

func (*InvalidError) SetKind

func (e *InvalidError) SetKind(kind string)

func (*InvalidError) Unwrap

func (e *InvalidError) Unwrap() error

type Kinded

type Kinded interface {
	Kind() string
	SetKind(string)
}

type NotFoundError

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

func (*NotFoundError) Ctx

func (e *NotFoundError) Ctx() string

func (*NotFoundError) CtxKind

func (e *NotFoundError) CtxKind() string

func (*NotFoundError) Elem

func (e *NotFoundError) Elem() *string

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

func (*NotFoundError) Kind

func (e *NotFoundError) Kind() string

func (*NotFoundError) SetKind

func (e *NotFoundError) SetKind(kind string)

func (*NotFoundError) Unwrap

func (e *NotFoundError) Unwrap() error

type NotImplementedError

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

func (*NotImplementedError) Ctx

func (e *NotImplementedError) Ctx() string

func (*NotImplementedError) CtxKind

func (e *NotImplementedError) CtxKind() string

func (*NotImplementedError) Elem

func (e *NotImplementedError) Elem() *string

func (*NotImplementedError) Error

func (e *NotImplementedError) Error() string

func (*NotImplementedError) Kind

func (e *NotImplementedError) Kind() string

func (*NotImplementedError) SetKind

func (e *NotImplementedError) SetKind(kind string)

func (*NotImplementedError) Unwrap

func (e *NotImplementedError) Unwrap() error

type NotSupportedError

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

func (*NotSupportedError) Ctx

func (e *NotSupportedError) Ctx() string

func (*NotSupportedError) CtxKind

func (e *NotSupportedError) CtxKind() string

func (*NotSupportedError) Elem

func (e *NotSupportedError) Elem() *string

func (*NotSupportedError) Error

func (e *NotSupportedError) Error() string

func (*NotSupportedError) Kind

func (e *NotSupportedError) Kind() string

func (*NotSupportedError) SetKind

func (e *NotSupportedError) SetKind(kind string)

func (*NotSupportedError) Unwrap

func (e *NotSupportedError) Unwrap() error

type ReadOnlyError

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

func (*ReadOnlyError) Ctx

func (e *ReadOnlyError) Ctx() string

func (*ReadOnlyError) CtxKind

func (e *ReadOnlyError) CtxKind() string

func (*ReadOnlyError) Elem

func (e *ReadOnlyError) Elem() *string

func (*ReadOnlyError) Error

func (e *ReadOnlyError) Error() string

func (*ReadOnlyError) Kind

func (e *ReadOnlyError) Kind() string

func (*ReadOnlyError) SetKind

func (e *ReadOnlyError) SetKind(kind string)

func (*ReadOnlyError) Unwrap

func (e *ReadOnlyError) Unwrap() error

type RecursionError

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

func (*RecursionError) Elem

func (e *RecursionError) Elem() interface{}

func (*RecursionError) Error

func (e *RecursionError) Error() string

func (*RecursionError) Kind

func (e *RecursionError) Kind() string

func (*RecursionError) Unwrap

func (e *RecursionError) Unwrap() error

type StillInUseError

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

func (*StillInUseError) Ctx

func (e *StillInUseError) Ctx() string

func (*StillInUseError) CtxKind

func (e *StillInUseError) CtxKind() string

func (*StillInUseError) Elem

func (e *StillInUseError) Elem() *string

func (*StillInUseError) Error

func (e *StillInUseError) Error() string

func (*StillInUseError) Kind

func (e *StillInUseError) Kind() string

func (*StillInUseError) SetKind

func (e *StillInUseError) SetKind(kind string)

func (*StillInUseError) Unwrap

func (e *StillInUseError) Unwrap() error

type UnknownError

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

func (*UnknownError) Ctx

func (e *UnknownError) Ctx() string

func (*UnknownError) CtxKind

func (e *UnknownError) CtxKind() string

func (*UnknownError) Elem

func (e *UnknownError) Elem() *string

func (*UnknownError) Error

func (e *UnknownError) Error() string

func (*UnknownError) Kind

func (e *UnknownError) Kind() string

func (*UnknownError) SetKind

func (e *UnknownError) SetKind(kind string)

func (*UnknownError) Unwrap

func (e *UnknownError) Unwrap() error

Jump to

Keyboard shortcuts

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