fail

package
v21.11.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

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 IsError

func IsError(err error) bool

IsError ...

func IsGRPCError

func IsGRPCError(err error) bool

IsGRPCError tells if the err is of GRPC kind

func IsGRPCTimeout

func IsGRPCTimeout(err error) bool

IsGRPCTimeout tells if the err is a ImplTimeout 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 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 a ErrAborted error If err != nil, this err will become the cause of the abortion that can be retrieved using Error.Cause()

func (*ErrAborted) AddConsequence

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

AddConsequence ...

func (*ErrAborted) Annotate

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

Annotate ...

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) CauseFormatter

func (e ErrAborted) CauseFormatter(formatter func(Error) string)

CauseFormatter defines the func uses to format cause to string

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 satisfies interface error

func (ErrAborted) GRPCCode

func (e ErrAborted) GRPCCode() codes.Code

GRPCCode returns the appropriate error code to use with gRPC

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) SetAnnotationFormatter

func (e ErrAborted) SetAnnotationFormatter(formatter func(data.Annotations) string)

SetAnnotationFormatter defines the func to use to format annotations

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

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 (*ErrAlteredNothing) AddConsequence

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

AddConsequence ...

func (*ErrAlteredNothing) Annotate

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

Annotate ...

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) CauseFormatter

func (e ErrAlteredNothing) CauseFormatter(formatter func(Error) string)

CauseFormatter defines the func uses to format cause to string

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 satisfies interface error

func (ErrAlteredNothing) GRPCCode

func (e ErrAlteredNothing) GRPCCode() codes.Code

GRPCCode returns the appropriate error code to use with gRPC

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) SetAnnotationFormatter

func (e ErrAlteredNothing) SetAnnotationFormatter(formatter func(data.Annotations) string)

SetAnnotationFormatter defines the func to use to format annotations

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

type ErrDuplicate

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

ErrDuplicate already exists error

func DuplicateError

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

DuplicateError creates a ErrDuplicate error

func DuplicateErrorWithCause

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

func (*ErrDuplicate) AddConsequence

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

AddConsequence ...

func (*ErrDuplicate) Annotate

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

Annotate ... 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) CauseFormatter

func (e ErrDuplicate) CauseFormatter(formatter func(Error) string)

CauseFormatter defines the func uses to format cause to string

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 satisfies interface error

func (ErrDuplicate) GRPCCode

func (e ErrDuplicate) GRPCCode() codes.Code

GRPCCode returns the appropriate error code to use with gRPC

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) SetAnnotationFormatter

func (e ErrDuplicate) SetAnnotationFormatter(formatter func(data.Annotations) string)

SetAnnotationFormatter defines the func to use to format annotations

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

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 a ErrExecution error

func (*ErrExecution) AddConsequence

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

AddConsequence ...

func (*ErrExecution) Annotate

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

Annotate ...

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) CauseFormatter

func (e ErrExecution) CauseFormatter(formatter func(Error) string)

CauseFormatter defines the func uses to format cause to string

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 satisfies interface error

func (ErrExecution) GRPCCode

func (e ErrExecution) GRPCCode() codes.Code

GRPCCode returns the appropriate error code to use with gRPC

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) SetAnnotationFormatter

func (e ErrExecution) SetAnnotationFormatter(formatter func(data.Annotations) string)

SetAnnotationFormatter defines the func to use to format annotations

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

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 a ErrForbidden error

func UnknownError

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

UnknownError creates a ErrForbidden error

func (*ErrForbidden) AddConsequence

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

AddConsequence ...

func (*ErrForbidden) Annotate

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

Annotate ...

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) CauseFormatter

func (e ErrForbidden) CauseFormatter(formatter func(Error) string)

CauseFormatter defines the func uses to format cause to string

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 satisfies interface error

func (ErrForbidden) GRPCCode

func (e ErrForbidden) GRPCCode() codes.Code

GRPCCode returns the appropriate error code to use with gRPC

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) SetAnnotationFormatter

func (e ErrForbidden) SetAnnotationFormatter(formatter func(data.Annotations) string)

SetAnnotationFormatter defines the func to use to format annotations

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

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 a ErrInconsistent error

func (*ErrInconsistent) AddConsequence

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

AddConsequence ...

func (*ErrInconsistent) Annotate

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

Annotate ...

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) CauseFormatter

func (e ErrInconsistent) CauseFormatter(formatter func(Error) string)

CauseFormatter defines the func uses to format cause to string

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 satisfies interface error

func (ErrInconsistent) GRPCCode

func (e ErrInconsistent) GRPCCode() codes.Code

GRPCCode returns the appropriate error code to use with gRPC

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) SetAnnotationFormatter

func (e ErrInconsistent) SetAnnotationFormatter(formatter func(data.Annotations) string)

SetAnnotationFormatter defines the func to use to format annotations

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

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 a ErrInvalidInstance error

func (*ErrInvalidInstance) AddConsequence

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

AddConsequence ...

func (*ErrInvalidInstance) Annotate

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

Annotate ...

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) CauseFormatter

func (e ErrInvalidInstance) CauseFormatter(formatter func(Error) string)

CauseFormatter defines the func uses to format cause to string

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 satisfies interface error

func (ErrInvalidInstance) GRPCCode

func (e ErrInvalidInstance) GRPCCode() codes.Code

GRPCCode returns the appropriate error code to use with gRPC

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) SetAnnotationFormatter

func (e ErrInvalidInstance) SetAnnotationFormatter(formatter func(data.Annotations) string)

SetAnnotationFormatter defines the func to use to format annotations

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

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 (*ErrInvalidInstanceContent) AddConsequence

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

AddConsequence ...

func (*ErrInvalidInstanceContent) Annotate

Annotate ...

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) CauseFormatter

func (e ErrInvalidInstanceContent) CauseFormatter(formatter func(Error) string)

CauseFormatter defines the func uses to format cause to string

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 satisfies interface error

func (ErrInvalidInstanceContent) GRPCCode

func (e ErrInvalidInstanceContent) GRPCCode() codes.Code

GRPCCode returns the appropriate error code to use with gRPC

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) SetAnnotationFormatter

func (e ErrInvalidInstanceContent) SetAnnotationFormatter(formatter func(data.Annotations) string)

SetAnnotationFormatter defines the func to use to format annotations

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

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 ...

func (*ErrInvalidParameter) AddConsequence

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

AddConsequence ...

func (*ErrInvalidParameter) Annotate

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

Annotate ...

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) CauseFormatter

func (e ErrInvalidParameter) CauseFormatter(formatter func(Error) string)

CauseFormatter defines the func uses to format cause to string

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 satisfies interface error

func (ErrInvalidParameter) GRPCCode

func (e ErrInvalidParameter) GRPCCode() codes.Code

GRPCCode returns the appropriate error code to use with gRPC

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) SetAnnotationFormatter

func (e ErrInvalidParameter) SetAnnotationFormatter(formatter func(data.Annotations) string)

SetAnnotationFormatter defines the func to use to format annotations

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

type ErrInvalidRequest

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

ErrInvalidRequest ...

func (*ErrInvalidRequest) AddConsequence

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

AddConsequence ...

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) CauseFormatter

func (e ErrInvalidRequest) CauseFormatter(formatter func(Error) string)

CauseFormatter defines the func uses to format cause to string

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 satisfies interface error

func (ErrInvalidRequest) GRPCCode

func (e ErrInvalidRequest) GRPCCode() codes.Code

GRPCCode returns the appropriate error code to use with gRPC

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) SetAnnotationFormatter

func (e ErrInvalidRequest) SetAnnotationFormatter(formatter func(data.Annotations) string)

SetAnnotationFormatter defines the func to use to format annotations

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

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 a ErrNotAuthenticated error

func (*ErrNotAuthenticated) AddConsequence

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

AddConsequence ...

func (*ErrNotAuthenticated) Annotate

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

Annotate ...

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) CauseFormatter

func (e ErrNotAuthenticated) CauseFormatter(formatter func(Error) string)

CauseFormatter defines the func uses to format cause to string

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 satisfies interface error

func (ErrNotAuthenticated) GRPCCode

func (e ErrNotAuthenticated) GRPCCode() codes.Code

GRPCCode returns the appropriate error code to use with gRPC

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) SetAnnotationFormatter

func (e ErrNotAuthenticated) SetAnnotationFormatter(formatter func(data.Annotations) string)

SetAnnotationFormatter defines the func to use to format annotations

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

type ErrNotAvailable

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

ErrNotAvailable resource not available error

func NotAvailableError

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

NotAvailableError creates a ErrNotAvailable error

func NotAvailableErrorWithCause

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

func (*ErrNotAvailable) AddConsequence

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

AddConsequence ...

func (*ErrNotAvailable) Annotate

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

Annotate ...

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) CauseFormatter

func (e ErrNotAvailable) CauseFormatter(formatter func(Error) string)

CauseFormatter defines the func uses to format cause to string

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 satisfies interface error

func (ErrNotAvailable) GRPCCode

func (e ErrNotAvailable) GRPCCode() codes.Code

GRPCCode returns the appropriate error code to use with gRPC

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) SetAnnotationFormatter

func (e ErrNotAvailable) SetAnnotationFormatter(formatter func(data.Annotations) string)

SetAnnotationFormatter defines the func to use to format annotations

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

type ErrNotFound

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

ErrNotFound resource not found error

func NotFoundError

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

NotFoundError creates a ErrNotFound error

func NotFoundErrorWithCause

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

func (*ErrNotFound) AddConsequence

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

AddConsequence ...

func (*ErrNotFound) Annotate

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

Annotate ...

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) CauseFormatter

func (e ErrNotFound) CauseFormatter(formatter func(Error) string)

CauseFormatter defines the func uses to format cause to string

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 satisfies interface error

func (ErrNotFound) GRPCCode

func (e ErrNotFound) GRPCCode() codes.Code

GRPCCode returns the appropriate error code to use with gRPC

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) SetAnnotationFormatter

func (e ErrNotFound) SetAnnotationFormatter(formatter func(data.Annotations) string)

SetAnnotationFormatter defines the func to use to format annotations

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

type ErrNotImplemented

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

ErrNotImplemented ...

func NotImplementedError

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

NotImplementedError creates a ErrNotImplemented report

func (*ErrNotImplemented) AddConsequence

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

AddConsequence ...

func (*ErrNotImplemented) Annotate

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

Annotate ...

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) CauseFormatter

func (e ErrNotImplemented) CauseFormatter(formatter func(Error) string)

CauseFormatter defines the func uses to format cause to string

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 satisfies interface error

func (ErrNotImplemented) GRPCCode

func (e ErrNotImplemented) GRPCCode() codes.Code

GRPCCode returns the appropriate error code to use with gRPC

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) SetAnnotationFormatter

func (e ErrNotImplemented) SetAnnotationFormatter(formatter func(data.Annotations) string)

SetAnnotationFormatter defines the func to use to format annotations

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

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 a ErrOverflow error

func (*ErrOverflow) AddConsequence

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

AddConsequence ...

func (*ErrOverflow) Annotate

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

Annotate ...

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) CauseFormatter

func (e ErrOverflow) CauseFormatter(formatter func(Error) string)

CauseFormatter defines the func uses to format cause to string

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 satisfies interface error

func (ErrOverflow) GRPCCode

func (e ErrOverflow) GRPCCode() codes.Code

GRPCCode returns the appropriate error code to use with gRPC

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) SetAnnotationFormatter

func (e ErrOverflow) SetAnnotationFormatter(formatter func(data.Annotations) string)

SetAnnotationFormatter defines the func to use to format annotations

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

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 a ErrOverload error

func (*ErrOverload) AddConsequence

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

AddConsequence ...

func (*ErrOverload) Annotate

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

Annotate ...

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) CauseFormatter

func (e ErrOverload) CauseFormatter(formatter func(Error) string)

CauseFormatter defines the func uses to format cause to string

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 satisfies interface error

func (ErrOverload) GRPCCode

func (e ErrOverload) GRPCCode() codes.Code

GRPCCode returns the appropriate error code to use with gRPC

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) SetAnnotationFormatter

func (e ErrOverload) SetAnnotationFormatter(formatter func(data.Annotations) string)

SetAnnotationFormatter defines the func to use to format annotations

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

type ErrRuntimePanic

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

ErrRuntimePanic ...

func RuntimePanicError

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

RuntimePanicError creates a ErrRuntimePanic error

func (*ErrRuntimePanic) AddConsequence

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

AddConsequence ...

func (*ErrRuntimePanic) Annotate

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

Annotate ...

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) CauseFormatter

func (e ErrRuntimePanic) CauseFormatter(formatter func(Error) string)

CauseFormatter defines the func uses to format cause to string

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 satisfies interface error

func (ErrRuntimePanic) GRPCCode

func (e ErrRuntimePanic) GRPCCode() codes.Code

GRPCCode returns the appropriate error code to use with gRPC

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) SetAnnotationFormatter

func (e ErrRuntimePanic) SetAnnotationFormatter(formatter func(data.Annotations) string)

SetAnnotationFormatter defines the func to use to format annotations

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

type ErrSyntax

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

ErrSyntax ...

func SyntaxError

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

SyntaxError creates a ErrSyntax error

func SyntaxErrorWithCause

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

func (*ErrSyntax) AddConsequence

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

AddConsequence ...

func (*ErrSyntax) Annotate

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

Annotate ...

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) CauseFormatter

func (e ErrSyntax) CauseFormatter(formatter func(Error) string)

CauseFormatter defines the func uses to format cause to string

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 satisfies interface error

func (ErrSyntax) GRPCCode

func (e ErrSyntax) GRPCCode() codes.Code

GRPCCode returns the appropriate error code to use with gRPC

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) SetAnnotationFormatter

func (e ErrSyntax) SetAnnotationFormatter(formatter func(data.Annotations) string)

SetAnnotationFormatter defines the func to use to format annotations

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

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 (*ErrTimeout) AddConsequence

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

AddConsequence ...

func (*ErrTimeout) Annotate

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

Annotate ...

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) CauseFormatter

func (e ErrTimeout) CauseFormatter(formatter func(Error) string)

CauseFormatter defines the func uses to format cause to string

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 satisfies interface error

func (ErrTimeout) GRPCCode

func (e ErrTimeout) GRPCCode() codes.Code

GRPCCode returns the appropriate error code to use with gRPC

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) SetAnnotationFormatter

func (e ErrTimeout) SetAnnotationFormatter(formatter func(data.Annotations) string)

SetAnnotationFormatter defines the func to use to format annotations

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

type ErrUnknown

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

ErrUnknown is used when situation is unknown

func (*ErrUnknown) AddConsequence

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

AddConsequence ...

func (*ErrUnknown) Annotate

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

Annotate ...

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) CauseFormatter

func (e ErrUnknown) CauseFormatter(formatter func(Error) string)

CauseFormatter defines the func uses to format cause to string

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 satisfies interface error

func (ErrUnknown) GRPCCode

func (e ErrUnknown) GRPCCode() codes.Code

GRPCCode returns the appropriate error code to use with gRPC

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) SetAnnotationFormatter

func (e ErrUnknown) SetAnnotationFormatter(formatter func(data.Annotations) string)

SetAnnotationFormatter defines the func to use to format annotations

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

type ErrUnqualified

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

ErrUnqualified is a generic Error type that has no particulaur 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 ... 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) CauseFormatter

func (e ErrUnqualified) CauseFormatter(formatter func(Error) string)

CauseFormatter defines the func uses to format cause to string

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 satisfies interface error

func (ErrUnqualified) GRPCCode

func (e ErrUnqualified) GRPCCode() codes.Code

GRPCCode returns the appropriate error code to use with gRPC

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) SetAnnotationFormatter

func (e ErrUnqualified) SetAnnotationFormatter(formatter func(data.Annotations) string)

SetAnnotationFormatter defines the func to use to format annotations

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

type ErrWarning

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

ErrWarning defines a ErrWarning error

func WarningError

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

WarningError returns an ErrWarning instance

func (*ErrWarning) AddConsequence

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

AddConsequence ...

func (*ErrWarning) Annotate

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

Annotate ...

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) CauseFormatter

func (e ErrWarning) CauseFormatter(formatter func(Error) string)

CauseFormatter defines the func uses to format cause to string

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 satisfies interface error

func (ErrWarning) GRPCCode

func (e ErrWarning) GRPCCode() codes.Code

GRPCCode returns the appropriate error code to use with gRPC

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) SetAnnotationFormatter

func (e ErrWarning) SetAnnotationFormatter(formatter func(data.Annotations) string)

SetAnnotationFormatter defines the func to use to format annotations

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

type Error

type Error interface {
	data.Annotatable

	error

	UnformattedError() string

	SetAnnotationFormatter(func(data.Annotations) string)

	GRPCCode() codes.Code
	ToGRPCStatus() error

	IsNull() bool
	// 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 a 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 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 NotImplementedErrorWithReason

func NotImplementedErrorWithReason(what string, why string) Error

NotImplementedErrorWithReason creates a 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) CauseFormatter

func (e ErrorList) CauseFormatter(formatter func(Error) string)

CauseFormatter defines the func uses to format cause to string

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) GRPCCode

func (e ErrorList) GRPCCode() codes.Code

GRPCCode returns the appropriate error code to use with gRPC

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) SetAnnotationFormatter

func (e ErrorList) SetAnnotationFormatter(formatter func(data.Annotations) string)

SetAnnotationFormatter defines the func to use to format annotations

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

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