fail

package
v21.11.1 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const EmbeddedErrorStructName = "errorCore"

Variables

This section is empty.

Functions

func AddConsequence

func AddConsequence(err error, cons error) error

AddConsequence adds an error 'err' to the list of consequences

func Cause

func Cause(err error) (resp error)

Cause returns the direct cause of an error if it implements the causer interface and that cause is not-nil in any other case, returns the unmodified error 'err'

func Consequences

func Consequences(err error) []error

Consequences returns the list of consequences

func IgnoreError added in v21.11.1

func IgnoreError(in interface{}, _ Error) interface{}

func IsError

func IsError(err error) bool

IsError ...

func IsGRPCError

func IsGRPCError(err error) bool

IsGRPCError tells if 'err' is of GRPC kind

func OnExitConvertToGRPCStatus

func OnExitConvertToGRPCStatus(err *error)

OnExitConvertToGRPCStatus converts err to GRPC Status.

func OnExitLogError

func OnExitLogError(err interface{}, msg ...interface{})

OnExitLogError logs error with level logrus.ErrorLevel. func OnExitLogError(in string, err *error) {

func OnExitLogErrorWithLevel

func OnExitLogErrorWithLevel(err interface{}, level logrus.Level, msg ...interface{})

OnExitLogErrorWithLevel logs error with the log level wanted

func OnExitTraceError

func OnExitTraceError(err interface{}, msg ...interface{})

OnExitTraceError logs error with level logrus.TraceLevel. func OnExitTraceError(in string, err *error) {

func OnExitWrapError

func OnExitWrapError(err interface{}, msg ...interface{})

OnExitWrapError wraps the error with the message

func OnPanic

func OnPanic(err interface{})

OnPanic captures panic error and fill the error pointer with a ErrRuntimePanic. func OnPanic(err *error) {

func RootCause

func RootCause(err error) (resp error)

RootCause follows the chain of causes / wrapped errors and returns the last not-nil error

func TakeError added in v21.11.1

func TakeError(_ interface{}, xerr Error) error

func ToGRPCStatus

func ToGRPCStatus(err error) error

ToGRPCStatus translates an error to a GRPC status

Types

type ErrAborted

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

ErrAborted is used to signal abortion

func AbortedError

func AbortedError(err error, msg ...interface{}) *ErrAborted

AbortedError creates an ErrAborted error If err != nil, 'err' will become the cause of the abortion that can be retrieved using Error.Cause()

func AbortedErrorWithCauseAndConsequences added in v21.11.1

func AbortedErrorWithCauseAndConsequences(err error, consequences []error, msg ...interface{}) *ErrAborted

AbortedErrorWithCauseAndConsequences creates an ErrAborted error

func (*ErrAborted) AddConsequence

func (e *ErrAborted) AddConsequence(err error) Error

AddConsequence adds a consequence 'err' to current error 'e'

func (*ErrAborted) Annotate

func (e *ErrAborted) Annotate(key string, value data.Annotation) data.Annotatable

Annotate adds an Annotation (key-value) pair to current error 'e', using the key 'key' and the value 'value'

func (ErrAborted) Annotation

func (e ErrAborted) Annotation(key string) (data.Annotation, bool)

Annotation ...

func (ErrAborted) Annotations

func (e ErrAborted) Annotations() data.Annotations

Annotations ...

func (ErrAborted) Cause

func (e ErrAborted) Cause() error

Cause is just an accessor for internal e.cause

func (ErrAborted) Consequences

func (e ErrAborted) Consequences() []error

Consequences returns the consequences of current error (detected teardown problems)

func (ErrAborted) Error

func (e ErrAborted) Error() string

Error returns a human-friendly error explanation

func (*ErrAborted) IsNull

func (e *ErrAborted) IsNull() bool

IsNull tells if the instance is null

func (ErrAborted) RootCause

func (e ErrAborted) RootCause() error

RootCause returns the initial error's cause

func (ErrAborted) ToGRPCStatus

func (e ErrAborted) ToGRPCStatus() error

ToGRPCStatus returns a grpcstatus struct from error

func (*ErrAborted) UnformattedError

func (e *ErrAborted) UnformattedError() string

UnformattedError returns Error() without any extra formatting applied

func (ErrAborted) Unwrap

func (e ErrAborted) Unwrap() error

Unwrap implements the Wrapper interface

func (ErrAborted) Valid added in v21.11.1

func (e ErrAborted) Valid() bool

Valid errorCore struct should be always created via newError constructor, if it doesn't we might miss e.lock initialization

type ErrAlteredNothing

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

ErrAlteredNothing is used when an Alter() call changed nothing

func AlteredNothingError

func AlteredNothingError(msg ...interface{}) *ErrAlteredNothing

AlteredNothingError creates an ErrAlteredNothing error

func AlteredNothingErrorWithCause added in v21.11.1

func AlteredNothingErrorWithCause(cause error, consequences []error, msg ...interface{}) *ErrAlteredNothing

AlteredNothingErrorWithCause creates an ErrAlteredNothing error

func (*ErrAlteredNothing) AddConsequence

func (e *ErrAlteredNothing) AddConsequence(err error) Error

AddConsequence adds a consequence 'err' to current error 'e'

func (*ErrAlteredNothing) Annotate

func (e *ErrAlteredNothing) Annotate(key string, value data.Annotation) data.Annotatable

Annotate adds an Annotation (key-value) pair to current error 'e', using the key 'key' and the value 'value'

func (ErrAlteredNothing) Annotation

func (e ErrAlteredNothing) Annotation(key string) (data.Annotation, bool)

Annotation ...

func (ErrAlteredNothing) Annotations

func (e ErrAlteredNothing) Annotations() data.Annotations

Annotations ...

func (ErrAlteredNothing) Cause

func (e ErrAlteredNothing) Cause() error

Cause is just an accessor for internal e.cause

func (ErrAlteredNothing) Consequences

func (e ErrAlteredNothing) Consequences() []error

Consequences returns the consequences of current error (detected teardown problems)

func (ErrAlteredNothing) Error

func (e ErrAlteredNothing) Error() string

Error returns a human-friendly error explanation

func (*ErrAlteredNothing) IsNull

func (e *ErrAlteredNothing) IsNull() bool

IsNull tells if the instance is null

func (ErrAlteredNothing) RootCause

func (e ErrAlteredNothing) RootCause() error

RootCause returns the initial error's cause

func (ErrAlteredNothing) ToGRPCStatus

func (e ErrAlteredNothing) ToGRPCStatus() error

ToGRPCStatus returns a grpcstatus struct from error

func (*ErrAlteredNothing) UnformattedError

func (e *ErrAlteredNothing) UnformattedError() string

UnformattedError returns Error() without any extra formatting applied

func (ErrAlteredNothing) Unwrap

func (e ErrAlteredNothing) Unwrap() error

Unwrap implements the Wrapper interface

func (ErrAlteredNothing) Valid added in v21.11.1

func (e ErrAlteredNothing) Valid() bool

Valid errorCore struct should be always created via newError constructor, if it doesn't we might miss e.lock initialization

type ErrDuplicate

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

ErrDuplicate already exists error

func DuplicateError

func DuplicateError(msg ...interface{}) *ErrDuplicate

DuplicateError creates an ErrDuplicate error

func DuplicateErrorWithCause

func DuplicateErrorWithCause(cause error, consequences []error, msg ...interface{}) *ErrDuplicate

DuplicateErrorWithCause creates an ErrDuplicate error initialized with cause 'cause'

func (*ErrDuplicate) AddConsequence

func (e *ErrDuplicate) AddConsequence(err error) Error

AddConsequence adds a consequence 'err' to current error 'e'

func (*ErrDuplicate) Annotate

func (e *ErrDuplicate) Annotate(key string, value data.Annotation) data.Annotatable

Annotate adds an Annotation (key-value) pair to current error 'e', using the key 'key' and the value 'value' satisfies interface data.Annotatable

func (ErrDuplicate) Annotation

func (e ErrDuplicate) Annotation(key string) (data.Annotation, bool)

Annotation ...

func (ErrDuplicate) Annotations

func (e ErrDuplicate) Annotations() data.Annotations

Annotations ...

func (ErrDuplicate) Cause

func (e ErrDuplicate) Cause() error

Cause is just an accessor for internal e.cause

func (ErrDuplicate) Consequences

func (e ErrDuplicate) Consequences() []error

Consequences returns the consequences of current error (detected teardown problems)

func (ErrDuplicate) Error

func (e ErrDuplicate) Error() string

Error returns a human-friendly error explanation

func (*ErrDuplicate) IsNull

func (e *ErrDuplicate) IsNull() bool

IsNull tells if the instance is null

func (ErrDuplicate) RootCause

func (e ErrDuplicate) RootCause() error

RootCause returns the initial error's cause

func (ErrDuplicate) ToGRPCStatus

func (e ErrDuplicate) ToGRPCStatus() error

ToGRPCStatus returns a grpcstatus struct from error

func (*ErrDuplicate) UnformattedError

func (e *ErrDuplicate) UnformattedError() string

UnformattedError returns Error() without any extra formatting applied

func (ErrDuplicate) Unwrap

func (e ErrDuplicate) Unwrap() error

Unwrap implements the Wrapper interface

func (ErrDuplicate) Valid added in v21.11.1

func (e ErrDuplicate) Valid() bool

Valid errorCore struct should be always created via newError constructor, if it doesn't we might miss e.lock initialization

type ErrExecution

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

ErrExecution is used when code ErrExecution failed

func ExecutionError

func ExecutionError(exitError error, msg ...interface{}) *ErrExecution

ExecutionError creates an ErrExecution error

func ExecutionErrorWithCause added in v21.11.1

func ExecutionErrorWithCause(exitError error, consequences []error, msg ...interface{}) *ErrExecution

ExecutionErrorWithCause creates an ErrExecution error

func (*ErrExecution) AddConsequence

func (e *ErrExecution) AddConsequence(err error) Error

AddConsequence adds a consequence 'err' to current error 'e'

func (*ErrExecution) Annotate

func (e *ErrExecution) Annotate(key string, value data.Annotation) data.Annotatable

Annotate adds an Annotation (key-value) pair to current error 'e', using the key 'key' and the value 'value'

func (ErrExecution) Annotation

func (e ErrExecution) Annotation(key string) (data.Annotation, bool)

Annotation ...

func (ErrExecution) Annotations

func (e ErrExecution) Annotations() data.Annotations

Annotations ...

func (ErrExecution) Cause

func (e ErrExecution) Cause() error

Cause is just an accessor for internal e.cause

func (ErrExecution) Consequences

func (e ErrExecution) Consequences() []error

Consequences returns the consequences of current error (detected teardown problems)

func (ErrExecution) Error

func (e ErrExecution) Error() string

Error returns a human-friendly error explanation

func (*ErrExecution) IsNull

func (e *ErrExecution) IsNull() bool

IsNull tells if the instance is null

func (ErrExecution) RootCause

func (e ErrExecution) RootCause() error

RootCause returns the initial error's cause

func (ErrExecution) ToGRPCStatus

func (e ErrExecution) ToGRPCStatus() error

ToGRPCStatus returns a grpcstatus struct from error

func (*ErrExecution) UnformattedError

func (e *ErrExecution) UnformattedError() string

UnformattedError returns Error() without any extra formatting applied

func (ErrExecution) Unwrap

func (e ErrExecution) Unwrap() error

Unwrap implements the Wrapper interface

func (ErrExecution) Valid added in v21.11.1

func (e ErrExecution) Valid() bool

Valid errorCore struct should be always created via newError constructor, if it doesn't we might miss e.lock initialization

type ErrForbidden

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

ErrForbidden when action is not allowed.

func ForbiddenError

func ForbiddenError(msg ...interface{}) *ErrForbidden

ForbiddenError creates an ErrForbidden error

func ForbiddenErrorWithCause added in v21.11.1

func ForbiddenErrorWithCause(cause error, consequences []error, msg ...interface{}) *ErrForbidden

ForbiddenErrorWithCause creates an ErrForbidden error

func (*ErrForbidden) AddConsequence

func (e *ErrForbidden) AddConsequence(err error) Error

AddConsequence adds a consequence 'err' to current error 'e'

func (*ErrForbidden) Annotate

func (e *ErrForbidden) Annotate(key string, value data.Annotation) data.Annotatable

Annotate adds an Annotation (key-value) pair to current error 'e', using the key 'key' and the value 'value'

func (ErrForbidden) Annotation

func (e ErrForbidden) Annotation(key string) (data.Annotation, bool)

Annotation ...

func (ErrForbidden) Annotations

func (e ErrForbidden) Annotations() data.Annotations

Annotations ...

func (ErrForbidden) Cause

func (e ErrForbidden) Cause() error

Cause is just an accessor for internal e.cause

func (ErrForbidden) Consequences

func (e ErrForbidden) Consequences() []error

Consequences returns the consequences of current error (detected teardown problems)

func (ErrForbidden) Error

func (e ErrForbidden) Error() string

Error returns a human-friendly error explanation

func (*ErrForbidden) IsNull

func (e *ErrForbidden) IsNull() bool

IsNull tells if the instance is null

func (ErrForbidden) RootCause

func (e ErrForbidden) RootCause() error

RootCause returns the initial error's cause

func (ErrForbidden) ToGRPCStatus

func (e ErrForbidden) ToGRPCStatus() error

ToGRPCStatus returns a grpcstatus struct from error

func (*ErrForbidden) UnformattedError

func (e *ErrForbidden) UnformattedError() string

UnformattedError returns Error() without any extra formatting applied

func (ErrForbidden) Unwrap

func (e ErrForbidden) Unwrap() error

Unwrap implements the Wrapper interface

func (ErrForbidden) Valid added in v21.11.1

func (e ErrForbidden) Valid() bool

Valid errorCore struct should be always created via newError constructor, if it doesn't we might miss e.lock initialization

type ErrInconsistent

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

ErrInconsistent is used when data used is ErrInconsistent

func InconsistentError

func InconsistentError(msg ...interface{}) *ErrInconsistent

InconsistentError creates an ErrInconsistent error

func InconsistentErrorWithCause added in v21.11.1

func InconsistentErrorWithCause(cause error, consequences []error, msg ...interface{}) *ErrInconsistent

InconsistentErrorWithCause creates an ErrInconsistent error

func (*ErrInconsistent) AddConsequence

func (e *ErrInconsistent) AddConsequence(err error) Error

AddConsequence adds a consequence 'err' to current error 'e'

func (*ErrInconsistent) Annotate

func (e *ErrInconsistent) Annotate(key string, value data.Annotation) data.Annotatable

Annotate adds an Annotation (key-value) pair to current error 'e', using the key 'key' and the value 'value'

func (ErrInconsistent) Annotation

func (e ErrInconsistent) Annotation(key string) (data.Annotation, bool)

Annotation ...

func (ErrInconsistent) Annotations

func (e ErrInconsistent) Annotations() data.Annotations

Annotations ...

func (ErrInconsistent) Cause

func (e ErrInconsistent) Cause() error

Cause is just an accessor for internal e.cause

func (ErrInconsistent) Consequences

func (e ErrInconsistent) Consequences() []error

Consequences returns the consequences of current error (detected teardown problems)

func (ErrInconsistent) Error

func (e ErrInconsistent) Error() string

Error returns a human-friendly error explanation

func (*ErrInconsistent) IsNull

func (e *ErrInconsistent) IsNull() bool

IsNull tells if the instance is null

func (ErrInconsistent) RootCause

func (e ErrInconsistent) RootCause() error

RootCause returns the initial error's cause

func (ErrInconsistent) ToGRPCStatus

func (e ErrInconsistent) ToGRPCStatus() error

ToGRPCStatus returns a grpcstatus struct from error

func (*ErrInconsistent) UnformattedError

func (e *ErrInconsistent) UnformattedError() string

UnformattedError returns Error() without any extra formatting applied

func (ErrInconsistent) Unwrap

func (e ErrInconsistent) Unwrap() error

Unwrap implements the Wrapper interface

func (ErrInconsistent) Valid added in v21.11.1

func (e ErrInconsistent) Valid() bool

Valid errorCore struct should be always created via newError constructor, if it doesn't we might miss e.lock initialization

type ErrInvalidInstance

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

ErrInvalidInstance has to be used when a method is called from an instance equal to nil

func InvalidInstanceError

func InvalidInstanceError() *ErrInvalidInstance

InvalidInstanceError creates an ErrInvalidInstance error

func InvalidInstanceErrorWithCause added in v21.11.1

func InvalidInstanceErrorWithCause(cause error, consequences []error, msg ...interface{}) *ErrInvalidInstance

InvalidInstanceErrorWithCause creates an ErrInvalidInstance error

func (*ErrInvalidInstance) AddConsequence

func (e *ErrInvalidInstance) AddConsequence(err error) Error

AddConsequence adds a consequence 'err' to current error 'e'

func (*ErrInvalidInstance) Annotate

func (e *ErrInvalidInstance) Annotate(key string, value data.Annotation) data.Annotatable

Annotate adds an Annotation (key-value) pair to current error 'e', using the key 'key' and the value 'value'

func (ErrInvalidInstance) Annotation

func (e ErrInvalidInstance) Annotation(key string) (data.Annotation, bool)

Annotation ...

func (ErrInvalidInstance) Annotations

func (e ErrInvalidInstance) Annotations() data.Annotations

Annotations ...

func (ErrInvalidInstance) Cause

func (e ErrInvalidInstance) Cause() error

Cause is just an accessor for internal e.cause

func (ErrInvalidInstance) Consequences

func (e ErrInvalidInstance) Consequences() []error

Consequences returns the consequences of current error (detected teardown problems)

func (ErrInvalidInstance) Error

func (e ErrInvalidInstance) Error() string

Error returns a human-friendly error explanation

func (*ErrInvalidInstance) IsNull

func (e *ErrInvalidInstance) IsNull() bool

IsNull tells if the instance is null

func (ErrInvalidInstance) RootCause

func (e ErrInvalidInstance) RootCause() error

RootCause returns the initial error's cause

func (ErrInvalidInstance) ToGRPCStatus

func (e ErrInvalidInstance) ToGRPCStatus() error

ToGRPCStatus returns a grpcstatus struct from error

func (*ErrInvalidInstance) UnformattedError

func (e *ErrInvalidInstance) UnformattedError() string

UnformattedError returns Error() without any extra formatting applied

func (ErrInvalidInstance) Unwrap

func (e ErrInvalidInstance) Unwrap() error

Unwrap implements the Wrapper interface

func (ErrInvalidInstance) Valid added in v21.11.1

func (e ErrInvalidInstance) Valid() bool

Valid errorCore struct should be always created via newError constructor, if it doesn't we might miss e.lock initialization

type ErrInvalidInstanceContent

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

ErrInvalidInstanceContent has to be used when a property of an instance contains invalid property

func InvalidInstanceContentError

func InvalidInstanceContentError(what, why string) *ErrInvalidInstanceContent

InvalidInstanceContentError returns an instance of ErrInvalidInstanceContent.

func InvalidInstanceContentErrorWithCause added in v21.11.1

func InvalidInstanceContentErrorWithCause(cause error, consequences []error, what, why string, msg ...interface{}) *ErrInvalidInstanceContent

InvalidInstanceContentErrorWithCause returns an instance of ErrInvalidInstanceContent.

func (*ErrInvalidInstanceContent) AddConsequence

func (e *ErrInvalidInstanceContent) AddConsequence(err error) Error

AddConsequence adds a consequence 'err' to current error 'e'

func (*ErrInvalidInstanceContent) Annotate

Annotate adds an Annotation (key-value) pair to current error 'e', using the key 'key' and the value 'value'

func (ErrInvalidInstanceContent) Annotation

func (e ErrInvalidInstanceContent) Annotation(key string) (data.Annotation, bool)

Annotation ...

func (ErrInvalidInstanceContent) Annotations

func (e ErrInvalidInstanceContent) Annotations() data.Annotations

Annotations ...

func (ErrInvalidInstanceContent) Cause

func (e ErrInvalidInstanceContent) Cause() error

Cause is just an accessor for internal e.cause

func (ErrInvalidInstanceContent) Consequences

func (e ErrInvalidInstanceContent) Consequences() []error

Consequences returns the consequences of current error (detected teardown problems)

func (ErrInvalidInstanceContent) Error

func (e ErrInvalidInstanceContent) Error() string

Error returns a human-friendly error explanation

func (*ErrInvalidInstanceContent) IsNull

func (e *ErrInvalidInstanceContent) IsNull() bool

IsNull tells if the instance is null

func (ErrInvalidInstanceContent) RootCause

func (e ErrInvalidInstanceContent) RootCause() error

RootCause returns the initial error's cause

func (ErrInvalidInstanceContent) ToGRPCStatus

func (e ErrInvalidInstanceContent) ToGRPCStatus() error

ToGRPCStatus returns a grpcstatus struct from error

func (*ErrInvalidInstanceContent) UnformattedError

func (e *ErrInvalidInstanceContent) UnformattedError() string

UnformattedError returns Error() without any extra formatting applied

func (ErrInvalidInstanceContent) Unwrap

func (e ErrInvalidInstanceContent) Unwrap() error

Unwrap implements the Wrapper interface

func (ErrInvalidInstanceContent) Valid added in v21.11.1

func (e ErrInvalidInstanceContent) Valid() bool

Valid errorCore struct should be always created via newError constructor, if it doesn't we might miss e.lock initialization

type ErrInvalidParameter

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

ErrInvalidParameter ...

func InvalidParameterCannotBeEmptyStringError

func InvalidParameterCannotBeEmptyStringError(what string) *ErrInvalidParameter

InvalidParameterCannotBeEmptyStringError is a specialized *ErrInvalidParameter with message "cannot be empty string"

func InvalidParameterCannotBeNilError

func InvalidParameterCannotBeNilError(what string) *ErrInvalidParameter

InvalidParameterCannotBeNilError is a specialized *ErrInvalidParameter with message "cannot be nil"

func InvalidParameterError

func InvalidParameterError(what string, why ...interface{}) *ErrInvalidParameter

InvalidParameterError creates an ErrInvalidParameter error

func InvalidParameterErrorWithCauseAndConsequences added in v21.11.1

func InvalidParameterErrorWithCauseAndConsequences(cause error, consequences []error, what string, skip uint, why ...interface{}) *ErrInvalidParameter

InvalidParameterErrorWithCauseAndConsequences creates an ErrInvalidParameter error

func (*ErrInvalidParameter) AddConsequence

func (e *ErrInvalidParameter) AddConsequence(err error) Error

AddConsequence adds a consequence 'err' to current error 'e'

func (*ErrInvalidParameter) Annotate

func (e *ErrInvalidParameter) Annotate(key string, value data.Annotation) data.Annotatable

Annotate adds an Annotation (key-value) pair to current error 'e', using the key 'key' and the value 'value'

func (ErrInvalidParameter) Annotation

func (e ErrInvalidParameter) Annotation(key string) (data.Annotation, bool)

Annotation ...

func (ErrInvalidParameter) Annotations

func (e ErrInvalidParameter) Annotations() data.Annotations

Annotations ...

func (ErrInvalidParameter) Cause

func (e ErrInvalidParameter) Cause() error

Cause is just an accessor for internal e.cause

func (ErrInvalidParameter) Consequences

func (e ErrInvalidParameter) Consequences() []error

Consequences returns the consequences of current error (detected teardown problems)

func (ErrInvalidParameter) Error

func (e ErrInvalidParameter) Error() string

Error returns a human-friendly error explanation

func (*ErrInvalidParameter) IsNull

func (e *ErrInvalidParameter) IsNull() bool

IsNull tells if the instance is null

func (ErrInvalidParameter) RootCause

func (e ErrInvalidParameter) RootCause() error

RootCause returns the initial error's cause

func (ErrInvalidParameter) ToGRPCStatus

func (e ErrInvalidParameter) ToGRPCStatus() error

ToGRPCStatus returns a grpcstatus struct from error

func (*ErrInvalidParameter) UnformattedError

func (e *ErrInvalidParameter) UnformattedError() string

UnformattedError returns Error() without any extra formatting applied

func (ErrInvalidParameter) Unwrap

func (e ErrInvalidParameter) Unwrap() error

Unwrap implements the Wrapper interface

func (ErrInvalidParameter) Valid added in v21.11.1

func (e ErrInvalidParameter) Valid() bool

Valid errorCore struct should be always created via newError constructor, if it doesn't we might miss e.lock initialization

type ErrInvalidRequest

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

ErrInvalidRequest ...

func (*ErrInvalidRequest) AddConsequence

func (e *ErrInvalidRequest) AddConsequence(err error) Error

AddConsequence adds a consequence 'err' to current error 'e'

func (*ErrInvalidRequest) Annotate

func (e *ErrInvalidRequest) Annotate(key string, value data.Annotation) data.Annotatable

Annotate overloads errorCore.Annotate() to make sure the type returned is the same as the caller satisfies interface data.Annotatable

func (ErrInvalidRequest) Annotation

func (e ErrInvalidRequest) Annotation(key string) (data.Annotation, bool)

Annotation ...

func (ErrInvalidRequest) Annotations

func (e ErrInvalidRequest) Annotations() data.Annotations

Annotations ...

func (ErrInvalidRequest) Cause

func (e ErrInvalidRequest) Cause() error

Cause is just an accessor for internal e.cause

func (ErrInvalidRequest) Consequences

func (e ErrInvalidRequest) Consequences() []error

Consequences returns the consequences of current error (detected teardown problems)

func (ErrInvalidRequest) Error

func (e ErrInvalidRequest) Error() string

Error returns a human-friendly error explanation

func (*ErrInvalidRequest) IsNull

func (e *ErrInvalidRequest) IsNull() bool

IsNull tells if the instance is null

func (ErrInvalidRequest) RootCause

func (e ErrInvalidRequest) RootCause() error

RootCause returns the initial error's cause

func (ErrInvalidRequest) ToGRPCStatus

func (e ErrInvalidRequest) ToGRPCStatus() error

ToGRPCStatus returns a grpcstatus struct from error

func (*ErrInvalidRequest) UnformattedError

func (e *ErrInvalidRequest) UnformattedError() string

UnformattedError returns Error() without any extra formatting applied

func (ErrInvalidRequest) Unwrap

func (e ErrInvalidRequest) Unwrap() error

Unwrap implements the Wrapper interface

func (ErrInvalidRequest) Valid added in v21.11.1

func (e ErrInvalidRequest) Valid() bool

Valid errorCore struct should be always created via newError constructor, if it doesn't we might miss e.lock initialization

type ErrNotAuthenticated

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

ErrNotAuthenticated when action is done without being authenticated first

func NotAuthenticatedError

func NotAuthenticatedError(msg ...interface{}) *ErrNotAuthenticated

NotAuthenticatedError creates an ErrNotAuthenticated error

func NotAuthenticatedErrorWithCause added in v21.11.1

func NotAuthenticatedErrorWithCause(cause error, consequences []error, msg ...interface{}) *ErrNotAuthenticated

NotAuthenticatedErrorWithCause creates an ErrNotAuthenticated error

func (*ErrNotAuthenticated) AddConsequence

func (e *ErrNotAuthenticated) AddConsequence(err error) Error

AddConsequence adds a consequence 'err' to current error 'e'

func (*ErrNotAuthenticated) Annotate

func (e *ErrNotAuthenticated) Annotate(key string, value data.Annotation) data.Annotatable

Annotate adds an Annotation (key-value) pair to current error 'e', using the key 'key' and the value 'value'

func (ErrNotAuthenticated) Annotation

func (e ErrNotAuthenticated) Annotation(key string) (data.Annotation, bool)

Annotation ...

func (ErrNotAuthenticated) Annotations

func (e ErrNotAuthenticated) Annotations() data.Annotations

Annotations ...

func (ErrNotAuthenticated) Cause

func (e ErrNotAuthenticated) Cause() error

Cause is just an accessor for internal e.cause

func (ErrNotAuthenticated) Consequences

func (e ErrNotAuthenticated) Consequences() []error

Consequences returns the consequences of current error (detected teardown problems)

func (ErrNotAuthenticated) Error

func (e ErrNotAuthenticated) Error() string

Error returns a human-friendly error explanation

func (*ErrNotAuthenticated) IsNull

func (e *ErrNotAuthenticated) IsNull() bool

IsNull tells if the instance is null

func (ErrNotAuthenticated) RootCause

func (e ErrNotAuthenticated) RootCause() error

RootCause returns the initial error's cause

func (ErrNotAuthenticated) ToGRPCStatus

func (e ErrNotAuthenticated) ToGRPCStatus() error

ToGRPCStatus returns a grpcstatus struct from error

func (*ErrNotAuthenticated) UnformattedError

func (e *ErrNotAuthenticated) UnformattedError() string

UnformattedError returns Error() without any extra formatting applied

func (ErrNotAuthenticated) Unwrap

func (e ErrNotAuthenticated) Unwrap() error

Unwrap implements the Wrapper interface

func (ErrNotAuthenticated) Valid added in v21.11.1

func (e ErrNotAuthenticated) Valid() bool

Valid errorCore struct should be always created via newError constructor, if it doesn't we might miss e.lock initialization

type ErrNotAvailable

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

ErrNotAvailable resource not available error

func NotAvailableError

func NotAvailableError(msg ...interface{}) *ErrNotAvailable

NotAvailableError creates an ErrNotAvailable error

func NotAvailableErrorWithCause

func NotAvailableErrorWithCause(cause error, consequences []error, msg ...interface{}) *ErrNotAvailable

NotAvailableErrorWithCause creates an ErrNotAvailable error initialized with a cause 'cause'

func (*ErrNotAvailable) AddConsequence

func (e *ErrNotAvailable) AddConsequence(err error) Error

AddConsequence adds a consequence 'err' to current error 'e'

func (*ErrNotAvailable) Annotate

func (e *ErrNotAvailable) Annotate(key string, value data.Annotation) data.Annotatable

Annotate adds an Annotation (key-value) pair to current error 'e', using the key 'key' and the value 'value'

func (ErrNotAvailable) Annotation

func (e ErrNotAvailable) Annotation(key string) (data.Annotation, bool)

Annotation ...

func (ErrNotAvailable) Annotations

func (e ErrNotAvailable) Annotations() data.Annotations

Annotations ...

func (ErrNotAvailable) Cause

func (e ErrNotAvailable) Cause() error

Cause is just an accessor for internal e.cause

func (ErrNotAvailable) Consequences

func (e ErrNotAvailable) Consequences() []error

Consequences returns the consequences of current error (detected teardown problems)

func (ErrNotAvailable) Error

func (e ErrNotAvailable) Error() string

Error returns a human-friendly error explanation

func (*ErrNotAvailable) IsNull

func (e *ErrNotAvailable) IsNull() bool

IsNull tells if the instance is null

func (ErrNotAvailable) RootCause

func (e ErrNotAvailable) RootCause() error

RootCause returns the initial error's cause

func (ErrNotAvailable) ToGRPCStatus

func (e ErrNotAvailable) ToGRPCStatus() error

ToGRPCStatus returns a grpcstatus struct from error

func (*ErrNotAvailable) UnformattedError

func (e *ErrNotAvailable) UnformattedError() string

UnformattedError returns Error() without any extra formatting applied

func (ErrNotAvailable) Unwrap

func (e ErrNotAvailable) Unwrap() error

Unwrap implements the Wrapper interface

func (ErrNotAvailable) Valid added in v21.11.1

func (e ErrNotAvailable) Valid() bool

Valid errorCore struct should be always created via newError constructor, if it doesn't we might miss e.lock initialization

type ErrNotFound

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

ErrNotFound resource not found error

func NotFoundError

func NotFoundError(msg ...interface{}) *ErrNotFound

NotFoundError creates an ErrNotFound error

func NotFoundErrorWithCause

func NotFoundErrorWithCause(cause error, consequences []error, msg ...interface{}) *ErrNotFound

NotFoundErrorWithCause creates an ErrNotFound error initialized with cause 'cause'

func (*ErrNotFound) AddConsequence

func (e *ErrNotFound) AddConsequence(err error) Error

AddConsequence adds a consequence 'err' to current error 'e'

func (*ErrNotFound) Annotate

func (e *ErrNotFound) Annotate(key string, value data.Annotation) data.Annotatable

Annotate adds an Annotation (key-value) pair to current error 'e', using the key 'key' and the value 'value'

func (ErrNotFound) Annotation

func (e ErrNotFound) Annotation(key string) (data.Annotation, bool)

Annotation ...

func (ErrNotFound) Annotations

func (e ErrNotFound) Annotations() data.Annotations

Annotations ...

func (ErrNotFound) Cause

func (e ErrNotFound) Cause() error

Cause is just an accessor for internal e.cause

func (ErrNotFound) Consequences

func (e ErrNotFound) Consequences() []error

Consequences returns the consequences of current error (detected teardown problems)

func (ErrNotFound) Error

func (e ErrNotFound) Error() string

Error returns a human-friendly error explanation

func (*ErrNotFound) IsNull

func (e *ErrNotFound) IsNull() bool

IsNull tells if the instance is null

func (ErrNotFound) RootCause

func (e ErrNotFound) RootCause() error

RootCause returns the initial error's cause

func (ErrNotFound) ToGRPCStatus

func (e ErrNotFound) ToGRPCStatus() error

ToGRPCStatus returns a grpcstatus struct from error

func (*ErrNotFound) UnformattedError

func (e *ErrNotFound) UnformattedError() string

UnformattedError returns Error() without any extra formatting applied

func (ErrNotFound) Unwrap

func (e ErrNotFound) Unwrap() error

Unwrap implements the Wrapper interface

func (ErrNotFound) Valid added in v21.11.1

func (e ErrNotFound) Valid() bool

Valid errorCore struct should be always created via newError constructor, if it doesn't we might miss e.lock initialization

type ErrNotImplemented

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

ErrNotImplemented ...

func NotImplementedError

func NotImplementedError(msg ...interface{}) *ErrNotImplemented

NotImplementedError creates an ErrNotImplemented report

func (*ErrNotImplemented) AddConsequence

func (e *ErrNotImplemented) AddConsequence(err error) Error

AddConsequence adds a consequence 'err' to current error 'e'

func (*ErrNotImplemented) Annotate

func (e *ErrNotImplemented) Annotate(key string, value data.Annotation) data.Annotatable

Annotate adds an Annotation (key-value) pair to current error 'e', using the key 'key' and the value 'value'

func (ErrNotImplemented) Annotation

func (e ErrNotImplemented) Annotation(key string) (data.Annotation, bool)

Annotation ...

func (ErrNotImplemented) Annotations

func (e ErrNotImplemented) Annotations() data.Annotations

Annotations ...

func (ErrNotImplemented) Cause

func (e ErrNotImplemented) Cause() error

Cause is just an accessor for internal e.cause

func (ErrNotImplemented) Consequences

func (e ErrNotImplemented) Consequences() []error

Consequences returns the consequences of current error (detected teardown problems)

func (ErrNotImplemented) Error

func (e ErrNotImplemented) Error() string

Error returns a human-friendly error explanation

func (*ErrNotImplemented) IsNull

func (e *ErrNotImplemented) IsNull() bool

IsNull tells if the instance is null

func (ErrNotImplemented) RootCause

func (e ErrNotImplemented) RootCause() error

RootCause returns the initial error's cause

func (ErrNotImplemented) ToGRPCStatus

func (e ErrNotImplemented) ToGRPCStatus() error

ToGRPCStatus returns a grpcstatus struct from error

func (*ErrNotImplemented) UnformattedError

func (e *ErrNotImplemented) UnformattedError() string

UnformattedError returns Error() without any extra formatting applied

func (ErrNotImplemented) Unwrap

func (e ErrNotImplemented) Unwrap() error

Unwrap implements the Wrapper interface

func (ErrNotImplemented) Valid added in v21.11.1

func (e ErrNotImplemented) Valid() bool

Valid errorCore struct should be always created via newError constructor, if it doesn't we might miss e.lock initialization

type ErrOverflow

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

ErrOverflow is used when a limit is reached

func OverflowError

func OverflowError(err error, limit uint, msg ...interface{}) *ErrOverflow

OverflowError creates an ErrOverflow error

func OverflowErrorWithCause added in v21.11.1

func OverflowErrorWithCause(err error, limit uint, consequences []error, msg ...interface{}) *ErrOverflow

OverflowErrorWithCause creates an ErrOverflow error

func (*ErrOverflow) AddConsequence

func (e *ErrOverflow) AddConsequence(err error) Error

AddConsequence adds a consequence 'err' to current error 'e'

func (*ErrOverflow) Annotate

func (e *ErrOverflow) Annotate(key string, value data.Annotation) data.Annotatable

Annotate adds an Annotation (key-value) pair to current error 'e', using the key 'key' and the value 'value'

func (ErrOverflow) Annotation

func (e ErrOverflow) Annotation(key string) (data.Annotation, bool)

Annotation ...

func (ErrOverflow) Annotations

func (e ErrOverflow) Annotations() data.Annotations

Annotations ...

func (ErrOverflow) Cause

func (e ErrOverflow) Cause() error

Cause is just an accessor for internal e.cause

func (ErrOverflow) Consequences

func (e ErrOverflow) Consequences() []error

Consequences returns the consequences of current error (detected teardown problems)

func (ErrOverflow) Error

func (e ErrOverflow) Error() string

Error returns a human-friendly error explanation

func (*ErrOverflow) IsNull

func (e *ErrOverflow) IsNull() bool

IsNull tells if the instance is null

func (ErrOverflow) RootCause

func (e ErrOverflow) RootCause() error

RootCause returns the initial error's cause

func (ErrOverflow) ToGRPCStatus

func (e ErrOverflow) ToGRPCStatus() error

ToGRPCStatus returns a grpcstatus struct from error

func (*ErrOverflow) UnformattedError

func (e *ErrOverflow) UnformattedError() string

UnformattedError returns Error() without any extra formatting applied

func (ErrOverflow) Unwrap

func (e ErrOverflow) Unwrap() error

Unwrap implements the Wrapper interface

func (ErrOverflow) Valid added in v21.11.1

func (e ErrOverflow) Valid() bool

Valid errorCore struct should be always created via newError constructor, if it doesn't we might miss e.lock initialization

type ErrOverload

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

ErrOverload when action cannot be honored because provider is overloaded (ie too many requests occurred in a given time).

func OverloadError

func OverloadError(msg ...interface{}) *ErrOverload

OverloadError creates an ErrOverload error

func OverloadErrorWithCause added in v21.11.1

func OverloadErrorWithCause(cause error, consequences []error, msg ...interface{}) *ErrOverload

OverloadErrorWithCause creates an ErrOverload error

func (*ErrOverload) AddConsequence

func (e *ErrOverload) AddConsequence(err error) Error

AddConsequence adds a consequence 'err' to current error 'e'

func (*ErrOverload) Annotate

func (e *ErrOverload) Annotate(key string, value data.Annotation) data.Annotatable

Annotate adds an Annotation (key-value) pair to current error 'e', using the key 'key' and the value 'value'

func (ErrOverload) Annotation

func (e ErrOverload) Annotation(key string) (data.Annotation, bool)

Annotation ...

func (ErrOverload) Annotations

func (e ErrOverload) Annotations() data.Annotations

Annotations ...

func (ErrOverload) Cause

func (e ErrOverload) Cause() error

Cause is just an accessor for internal e.cause

func (ErrOverload) Consequences

func (e ErrOverload) Consequences() []error

Consequences returns the consequences of current error (detected teardown problems)

func (ErrOverload) Error

func (e ErrOverload) Error() string

Error returns a human-friendly error explanation

func (*ErrOverload) IsNull

func (e *ErrOverload) IsNull() bool

IsNull tells if the instance is null

func (ErrOverload) RootCause

func (e ErrOverload) RootCause() error

RootCause returns the initial error's cause

func (ErrOverload) ToGRPCStatus

func (e ErrOverload) ToGRPCStatus() error

ToGRPCStatus returns a grpcstatus struct from error

func (*ErrOverload) UnformattedError

func (e *ErrOverload) UnformattedError() string

UnformattedError returns Error() without any extra formatting applied

func (ErrOverload) Unwrap

func (e ErrOverload) Unwrap() error

Unwrap implements the Wrapper interface

func (ErrOverload) Valid added in v21.11.1

func (e ErrOverload) Valid() bool

Valid errorCore struct should be always created via newError constructor, if it doesn't we might miss e.lock initialization

type ErrRuntimePanic

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

ErrRuntimePanic ...

func RuntimePanicError

func RuntimePanicError(pattern string, msg ...interface{}) *ErrRuntimePanic

RuntimePanicError creates an ErrRuntimePanic error

func RuntimePanicErrorWithCauseAndConsequences added in v21.11.1

func RuntimePanicErrorWithCauseAndConsequences(cause error, consequences []error, overwrite bool, msg ...interface{}) *ErrRuntimePanic

RuntimePanicErrorWithCauseAndConsequences creates an ErrRuntimePanic error

func (*ErrRuntimePanic) AddConsequence

func (e *ErrRuntimePanic) AddConsequence(err error) Error

AddConsequence adds a consequence 'err' to current error 'e'

func (*ErrRuntimePanic) Annotate

func (e *ErrRuntimePanic) Annotate(key string, value data.Annotation) data.Annotatable

Annotate adds an Annotation (key-value) pair to current error 'e', using the key 'key' and the value 'value'

func (ErrRuntimePanic) Annotation

func (e ErrRuntimePanic) Annotation(key string) (data.Annotation, bool)

Annotation ...

func (ErrRuntimePanic) Annotations

func (e ErrRuntimePanic) Annotations() data.Annotations

Annotations ...

func (ErrRuntimePanic) Cause

func (e ErrRuntimePanic) Cause() error

Cause is just an accessor for internal e.cause

func (ErrRuntimePanic) Consequences

func (e ErrRuntimePanic) Consequences() []error

Consequences returns the consequences of current error (detected teardown problems)

func (ErrRuntimePanic) Error

func (e ErrRuntimePanic) Error() string

Error returns a human-friendly error explanation

func (*ErrRuntimePanic) IsNull

func (e *ErrRuntimePanic) IsNull() bool

IsNull tells if the instance is null

func (ErrRuntimePanic) RootCause

func (e ErrRuntimePanic) RootCause() error

RootCause returns the initial error's cause

func (ErrRuntimePanic) ToGRPCStatus

func (e ErrRuntimePanic) ToGRPCStatus() error

ToGRPCStatus returns a grpcstatus struct from error

func (*ErrRuntimePanic) UnformattedError

func (e *ErrRuntimePanic) UnformattedError() string

UnformattedError returns Error() without any extra formatting applied

func (ErrRuntimePanic) Unwrap

func (e ErrRuntimePanic) Unwrap() error

Unwrap implements the Wrapper interface

func (ErrRuntimePanic) Valid added in v21.11.1

func (e ErrRuntimePanic) Valid() bool

Valid errorCore struct should be always created via newError constructor, if it doesn't we might miss e.lock initialization

type ErrSyntax

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

ErrSyntax ...

func SyntaxError

func SyntaxError(msg ...interface{}) *ErrSyntax

SyntaxError creates an ErrSyntax error

func SyntaxErrorWithCause

func SyntaxErrorWithCause(cause error, consequences []error, msg ...interface{}) *ErrSyntax

SyntaxErrorWithCause creates an ErrSyntax error initialized with cause 'cause'

func (*ErrSyntax) AddConsequence

func (e *ErrSyntax) AddConsequence(err error) Error

AddConsequence adds a consequence 'err' to current error 'e'

func (*ErrSyntax) Annotate

func (e *ErrSyntax) Annotate(key string, value data.Annotation) data.Annotatable

Annotate adds an Annotation (key-value) pair to current error 'e', using the key 'key' and the value 'value'

func (ErrSyntax) Annotation

func (e ErrSyntax) Annotation(key string) (data.Annotation, bool)

Annotation ...

func (ErrSyntax) Annotations

func (e ErrSyntax) Annotations() data.Annotations

Annotations ...

func (ErrSyntax) Cause

func (e ErrSyntax) Cause() error

Cause is just an accessor for internal e.cause

func (ErrSyntax) Consequences

func (e ErrSyntax) Consequences() []error

Consequences returns the consequences of current error (detected teardown problems)

func (ErrSyntax) Error

func (e ErrSyntax) Error() string

Error returns a human-friendly error explanation

func (*ErrSyntax) IsNull

func (e *ErrSyntax) IsNull() bool

IsNull tells if the instance is null

func (ErrSyntax) RootCause

func (e ErrSyntax) RootCause() error

RootCause returns the initial error's cause

func (ErrSyntax) ToGRPCStatus

func (e ErrSyntax) ToGRPCStatus() error

ToGRPCStatus returns a grpcstatus struct from error

func (*ErrSyntax) UnformattedError

func (e *ErrSyntax) UnformattedError() string

UnformattedError returns Error() without any extra formatting applied

func (ErrSyntax) Unwrap

func (e ErrSyntax) Unwrap() error

Unwrap implements the Wrapper interface

func (ErrSyntax) Valid added in v21.11.1

func (e ErrSyntax) Valid() bool

Valid errorCore struct should be always created via newError constructor, if it doesn't we might miss e.lock initialization

type ErrTimeout

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

ErrTimeout defines a ErrTimeout error

func TimeoutError

func TimeoutError(cause error, dur time.Duration, msg ...interface{}) *ErrTimeout

TimeoutError returns an ErrTimeout instance

func TimeoutErrorWithCauseAndConsequences added in v21.11.1

func TimeoutErrorWithCauseAndConsequences(cause error, dur time.Duration, consequences []error, msg ...interface{}) *ErrTimeout

TimeoutErrorWithCauseAndConsequences returns an ErrTimeout instance

func (*ErrTimeout) AddConsequence

func (e *ErrTimeout) AddConsequence(err error) Error

AddConsequence adds a consequence 'err' to current error 'e'

func (*ErrTimeout) Annotate

func (e *ErrTimeout) Annotate(key string, value data.Annotation) data.Annotatable

Annotate adds an Annotation (key-value) pair to current error 'e', using the key 'key' and the value 'value'

func (ErrTimeout) Annotation

func (e ErrTimeout) Annotation(key string) (data.Annotation, bool)

Annotation ...

func (ErrTimeout) Annotations

func (e ErrTimeout) Annotations() data.Annotations

Annotations ...

func (ErrTimeout) Cause

func (e ErrTimeout) Cause() error

Cause is just an accessor for internal e.cause

func (ErrTimeout) Consequences

func (e ErrTimeout) Consequences() []error

Consequences returns the consequences of current error (detected teardown problems)

func (ErrTimeout) Error

func (e ErrTimeout) Error() string

Error returns a human-friendly error explanation

func (*ErrTimeout) IsNull

func (e *ErrTimeout) IsNull() bool

IsNull tells if the instance is null

func (ErrTimeout) RootCause

func (e ErrTimeout) RootCause() error

RootCause returns the initial error's cause

func (ErrTimeout) ToGRPCStatus

func (e ErrTimeout) ToGRPCStatus() error

ToGRPCStatus returns a grpcstatus struct from error

func (*ErrTimeout) UnformattedError

func (e *ErrTimeout) UnformattedError() string

UnformattedError returns Error() without any extra formatting applied

func (ErrTimeout) Unwrap

func (e ErrTimeout) Unwrap() error

Unwrap implements the Wrapper interface

func (ErrTimeout) Valid added in v21.11.1

func (e ErrTimeout) Valid() bool

Valid errorCore struct should be always created via newError constructor, if it doesn't we might miss e.lock initialization

type ErrUnknown

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

ErrUnknown is used when situation is unknown

func UnknownError

func UnknownError(msg ...interface{}) *ErrUnknown

UnknownError creates an ErrUnknown error

func UnknownErrorWithCause added in v21.11.1

func UnknownErrorWithCause(cause error, consequences []error, msg ...interface{}) *ErrUnknown

UnknownErrorWithCause creates an ErrUnknown error

func (*ErrUnknown) AddConsequence

func (e *ErrUnknown) AddConsequence(err error) Error

AddConsequence adds a consequence 'err' to current error 'e'

func (*ErrUnknown) Annotate

func (e *ErrUnknown) Annotate(key string, value data.Annotation) data.Annotatable

Annotate adds an Annotation (key-value) pair to current error 'e', using the key 'key' and the value 'value'

func (ErrUnknown) Annotation

func (e ErrUnknown) Annotation(key string) (data.Annotation, bool)

Annotation ...

func (ErrUnknown) Annotations

func (e ErrUnknown) Annotations() data.Annotations

Annotations ...

func (ErrUnknown) Cause

func (e ErrUnknown) Cause() error

Cause is just an accessor for internal e.cause

func (ErrUnknown) Consequences

func (e ErrUnknown) Consequences() []error

Consequences returns the consequences of current error (detected teardown problems)

func (ErrUnknown) Error

func (e ErrUnknown) Error() string

Error returns a human-friendly error explanation

func (*ErrUnknown) IsNull

func (e *ErrUnknown) IsNull() bool

IsNull tells if the instance is null

func (ErrUnknown) RootCause

func (e ErrUnknown) RootCause() error

RootCause returns the initial error's cause

func (ErrUnknown) ToGRPCStatus

func (e ErrUnknown) ToGRPCStatus() error

ToGRPCStatus returns a grpcstatus struct from error

func (*ErrUnknown) UnformattedError

func (e *ErrUnknown) UnformattedError() string

UnformattedError returns Error() without any extra formatting applied

func (ErrUnknown) Unwrap

func (e ErrUnknown) Unwrap() error

Unwrap implements the Wrapper interface

func (ErrUnknown) Valid added in v21.11.1

func (e ErrUnknown) Valid() bool

Valid errorCore struct should be always created via newError constructor, if it doesn't we might miss e.lock initialization

type ErrUnqualified

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

ErrUnqualified is a generic Error type that has no particular signification

func (ErrUnqualified) AddConsequence

func (e ErrUnqualified) AddConsequence(err error) Error

AddConsequence adds an error 'err' to the list of consequences

func (ErrUnqualified) Annotate

func (e ErrUnqualified) Annotate(key string, value data.Annotation) data.Annotatable

Annotate adds an Annotation (key-value) pair to current error 'e', using the key 'key' and the value 'value' satisfies interface data.Annotatable

func (ErrUnqualified) Annotation

func (e ErrUnqualified) Annotation(key string) (data.Annotation, bool)

Annotation ...

func (ErrUnqualified) Annotations

func (e ErrUnqualified) Annotations() data.Annotations

Annotations ...

func (ErrUnqualified) Cause

func (e ErrUnqualified) Cause() error

Cause is just an accessor for internal e.cause

func (ErrUnqualified) Consequences

func (e ErrUnqualified) Consequences() []error

Consequences returns the consequences of current error (detected teardown problems)

func (ErrUnqualified) Error

func (e ErrUnqualified) Error() string

Error returns a human-friendly error explanation

func (ErrUnqualified) IsNull

func (e ErrUnqualified) IsNull() bool

IsNull tells if the instance is to be considered as null value

func (ErrUnqualified) RootCause

func (e ErrUnqualified) RootCause() error

RootCause returns the initial error's cause

func (ErrUnqualified) ToGRPCStatus

func (e ErrUnqualified) ToGRPCStatus() error

ToGRPCStatus returns a grpcstatus struct from error

func (ErrUnqualified) UnformattedError

func (e ErrUnqualified) UnformattedError() string

UnformattedError returns a human-friendly error explanation satisfies interface error

func (ErrUnqualified) Unwrap

func (e ErrUnqualified) Unwrap() error

Unwrap implements the Wrapper interface

func (ErrUnqualified) Valid added in v21.11.1

func (e ErrUnqualified) Valid() bool

Valid errorCore struct should be always created via newError constructor, if it doesn't we might miss e.lock initialization

type ErrWarning

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

ErrWarning defines an ErrWarning error

func WarningError

func WarningError(cause error, msg ...interface{}) *ErrWarning

WarningError returns an ErrWarning instance

func WarningErrorWithCauseAndConsequences added in v21.11.1

func WarningErrorWithCauseAndConsequences(cause error, consequences []error, msg ...interface{}) *ErrWarning

WarningErrorWithCauseAndConsequences return an ErrWarning instance

func (*ErrWarning) AddConsequence

func (e *ErrWarning) AddConsequence(err error) Error

AddConsequence adds a consequence 'err' to current error 'e'

func (*ErrWarning) Annotate

func (e *ErrWarning) Annotate(key string, value data.Annotation) data.Annotatable

Annotate adds an Annotation (key-value) pair to current error 'e', using the key 'key' and the value 'value'

func (ErrWarning) Annotation

func (e ErrWarning) Annotation(key string) (data.Annotation, bool)

Annotation ...

func (ErrWarning) Annotations

func (e ErrWarning) Annotations() data.Annotations

Annotations ...

func (ErrWarning) Cause

func (e ErrWarning) Cause() error

Cause is just an accessor for internal e.cause

func (ErrWarning) Consequences

func (e ErrWarning) Consequences() []error

Consequences returns the consequences of current error (detected teardown problems)

func (ErrWarning) Error

func (e ErrWarning) Error() string

Error returns a human-friendly error explanation

func (*ErrWarning) IsNull

func (e *ErrWarning) IsNull() bool

IsNull tells if the instance is null

func (ErrWarning) RootCause

func (e ErrWarning) RootCause() error

RootCause returns the initial error's cause

func (ErrWarning) ToGRPCStatus

func (e ErrWarning) ToGRPCStatus() error

ToGRPCStatus returns a grpcstatus struct from error

func (*ErrWarning) UnformattedError

func (e *ErrWarning) UnformattedError() string

UnformattedError returns Error() without any extra formatting applied

func (ErrWarning) Unwrap

func (e ErrWarning) Unwrap() error

Unwrap implements the Wrapper interface

func (ErrWarning) Valid added in v21.11.1

func (e ErrWarning) Valid() bool

Valid errorCore struct should be always created via newError constructor, if it doesn't we might miss e.lock initialization

type Error

type Error interface {
	data.Annotatable

	error
	data.NullValue
	data.Validatable

	UnformattedError() string
	ToGRPCStatus() error
	// contains filtered or unexported methods
}

Error defines the interface of a SafeScale error

func Annotate

func Annotate(err error, key string, content interface{}) Error

Annotate ...

func ConvertError

func ConvertError(err error) Error

ConvertError converts an error to a fail.Error

func FromGRPCStatus

func FromGRPCStatus(err error) Error

FromGRPCStatus translates GRPC status to error

func InvalidRequestError

func InvalidRequestError(msg ...interface{}) Error

InvalidRequestError creates an ErrInvalidRequest error

func InvalidRequestErrorWithCause added in v21.11.1

func InvalidRequestErrorWithCause(cause error, consequences []error, msg ...interface{}) Error

InvalidRequestErrorWithCause creates an ErrInvalidRequest error

func NewError

func NewError(msg ...interface{}) Error

NewError creates a new failure report

func NewErrorList

func NewErrorList(errors []error) Error

NewErrorList creates a ErrorList

func NewErrorListComplete added in v21.11.1

func NewErrorListComplete(errors []error, cause error, consequences []error, msg ...interface{}) Error

func NewErrorWithCause

func NewErrorWithCause(cause error, msg ...interface{}) Error

NewErrorWithCause creates a new failure report with a cause

func NewErrorWithCauseAndConsequences

func NewErrorWithCauseAndConsequences(cause error, consequences []error, msg ...interface{}) Error

NewErrorWithCauseAndConsequences creates a new failure report with a cause and a list of teardown problems 'consequences'

func NotImplementedErrorWithCauseAndConsequences added in v21.11.1

func NotImplementedErrorWithCauseAndConsequences(cause error, consequences []error, msg ...interface{}) Error

NotImplementedErrorWithCauseAndConsequences creates an ErrNotImplemented report

func Wrap

func Wrap(cause error, msg ...interface{}) Error

Wrap creates a new error with a message 'msg' and a causer error 'cause'

type ErrorLike

type ErrorLike interface {
	IsError() bool
}

ErrorLike interface

type ErrorList

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

ErrorList ...

func (*ErrorList) AddConsequence

func (el *ErrorList) AddConsequence(err error) Error

AddConsequence ...

func (*ErrorList) Annotate

func (el *ErrorList) Annotate(key string, value data.Annotation) data.Annotatable

Annotate ... satisfies interface data.Annotatable

func (ErrorList) Annotation

func (e ErrorList) Annotation(key string) (data.Annotation, bool)

Annotation ...

func (ErrorList) Annotations

func (e ErrorList) Annotations() data.Annotations

Annotations ...

func (ErrorList) Cause

func (e ErrorList) Cause() error

Cause is just an accessor for internal e.cause

func (ErrorList) Consequences

func (e ErrorList) Consequences() []error

Consequences returns the consequences of current error (detected teardown problems)

func (*ErrorList) Error

func (el *ErrorList) Error() string

Error returns a string containing all the errors

func (ErrorList) IsNull

func (e ErrorList) IsNull() bool

IsNull tells if the instance is to be considered as null value

func (ErrorList) RootCause

func (e ErrorList) RootCause() error

RootCause returns the initial error's cause

func (*ErrorList) ToErrorSlice

func (el *ErrorList) ToErrorSlice() []error

ToErrorSlice transforms ErrorList to []error

func (ErrorList) ToGRPCStatus

func (el ErrorList) ToGRPCStatus() error

ToGRPCStatus returns a grpcstatus struct from ErrorList

func (*ErrorList) UnformattedError

func (el *ErrorList) UnformattedError() string

UnformattedError returns Error() without any extra formatting applied

func (ErrorList) Unwrap

func (e ErrorList) Unwrap() error

Unwrap implements the Wrapper interface

func (ErrorList) Valid added in v21.11.1

func (e ErrorList) Valid() bool

Valid errorCore struct should be always created via newError constructor, if it doesn't we might miss e.lock initialization

type Status

type Status interface {
	Message() string
	Cause() error
	IsError() bool
}

Status interface

func StatusWrapErr

func StatusWrapErr(err error, msg string) Status

StatusWrapErr ...

func Success

func Success(msg string, args ...interface{}) Status

Success ..

Jump to

Keyboard shortcuts

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