Documentation ¶
Index ¶
- func AddConsequence(err error, cons error) error
- func Cause(err error) (resp error)
- func Consequences(err error) []error
- func DecorateError(err error, action string, timeout time.Duration) error
- func ErrListError(errors []error) error
- func IsGRPCTimeout(err error) bool
- func OnExitLogError(in string, err *error) func()
- func OnExitLogErrorWithLevel(in string, err *error, level logrus.Level) func()
- func OnExitTraceError(in string, err *error) func()
- func OnPanic(err *error) func()
- type ErrAborted
- type ErrCore
- type ErrDuplicate
- type ErrForbidden
- type ErrInconsistent
- type ErrInvalidInstance
- type ErrInvalidInstanceContent
- type ErrInvalidParameter
- type ErrInvalidRequest
- type ErrList
- type ErrNotAvailable
- type ErrNotFound
- type ErrNotImplemented
- type ErrOverflow
- type ErrOverload
- type ErrRuntimePanic
- type ErrTimeout
- type ErrUnauthorized
- type ErrorLike
- type Status
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddConsequence ¶
AddConsequence adds an error 'err' to the list of consequences
func Consequences ¶
Consequences returns the list of consequences
func DecorateError ¶
DecorateError changes the error to something more comprehensible when timeout occurred
func IsGRPCTimeout ¶
IsGRPCTimeout tells if the err is a timeout kind
func OnExitLogError ¶
OnExitLogError returns a function that will log error with level logrus.ErrorLevel. Intended to be used with defer for example
func OnExitLogErrorWithLevel ¶
OnExitLogErrorWithLevel returns a function that will log error with the log level wanted Intended to be used with defer for example.
func OnExitTraceError ¶
OnExitTraceError returns a function that will log error with level logrus.TraceLevel. Intended to be used with defer for example.
Types ¶
type ErrAborted ¶
type ErrAborted struct {
ErrCore
}
ErrAborted ...
func (ErrAborted) AddConsequence ¶
func (e ErrAborted) AddConsequence(err error) error
AddConsequence adds an error 'err' to the list of consequences
type ErrCore ¶
type ErrCore struct { Message string // contains filtered or unexported fields }
ErrCore ...
func NewErrCore ¶
NewErrCore creates a new error with a message 'message', a cause error 'cause' and a list of teardown problems 'consequences'
func (ErrCore) AddConsequence ¶
AddConsequence adds an error 'err' to the list of consequences
func (ErrCore) CauseFormatter ¶
CauseFormatter generates a string containing information about the causing error and the derived errors while trying to clean up
func (ErrCore) Consequences ¶
Consequences returns the consequences of current error (detected teardown problems)
type ErrDuplicate ¶
type ErrDuplicate struct {
ErrCore
}
ErrDuplicate already exists error
func DuplicateError ¶
func DuplicateError(msg string) ErrDuplicate
DuplicateError creates a ErrDuplicate error
func (ErrDuplicate) AddConsequence ¶
func (e ErrDuplicate) AddConsequence(err error) error
AddConsequence adds an error 'err' to the list of consequences
type ErrForbidden ¶
type ErrForbidden struct {
ErrCore
}
ErrForbidden when action is not allowed.
func ForbiddenError ¶
func ForbiddenError(msg string) ErrForbidden
ForbiddenError creates a ErrForbidden error
func (ErrForbidden) AddConsequence ¶
func (e ErrForbidden) AddConsequence(err error) error
AddConsequence adds an error 'err' to the list of consequences
type ErrInconsistent ¶
type ErrInconsistent struct {
ErrCore
}
ErrInconsistent is used when data used is inconsistent
func InconsistentError ¶
func InconsistentError(msg string) ErrInconsistent
InconsistentError creates a ErrInconsistent error
func (ErrInconsistent) AddConsequence ¶
func (e ErrInconsistent) AddConsequence(err error) error
AddConsequence adds an error 'err' to the list of consequences
type ErrInvalidInstance ¶
type ErrInvalidInstance struct {
ErrCore
}
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 adds an error 'err' to the list of consequences
type ErrInvalidInstanceContent ¶
type ErrInvalidInstanceContent struct {
ErrCore
}
ErrInvalidInstanceContent has to be used when a property of an instance contains invalid property
func InvalidInstanceContentError ¶
func InvalidInstanceContentError(what, why string) ErrInvalidInstanceContent
InvalidInstanceContentError ...
func (ErrInvalidInstanceContent) AddConsequence ¶
func (e ErrInvalidInstanceContent) AddConsequence(err error) error
AddConsequence adds an error 'err' to the list of consequences
type ErrInvalidParameter ¶
type ErrInvalidParameter struct {
ErrCore
}
ErrInvalidParameter ...
func InvalidParameterError ¶
func InvalidParameterError(what, why string) ErrInvalidParameter
InvalidParameterError creates a ErrInvalidParameter error
func (ErrInvalidParameter) AddConsequence ¶
func (e ErrInvalidParameter) AddConsequence(err error) error
AddConsequence adds an error 'err' to the list of consequences
type ErrInvalidRequest ¶
type ErrInvalidRequest struct {
ErrCore
}
ErrInvalidRequest ...
func InvalidRequestError ¶
func InvalidRequestError(msg string) ErrInvalidRequest
InvalidRequestError creates a ErrInvalidRequest error
func (ErrInvalidRequest) AddConsequence ¶
func (e ErrInvalidRequest) AddConsequence(err error) error
AddConsequence adds an error 'err' to the list of consequences
type ErrList ¶
type ErrList struct { ErrCore // contains filtered or unexported fields }
ErrList ...
func (ErrList) AddConsequence ¶
AddConsequence adds an error 'err' to the list of consequences
type ErrNotAvailable ¶
type ErrNotAvailable struct {
ErrCore
}
ErrNotAvailable resource not available error
func NotAvailableError ¶
func NotAvailableError(msg string) ErrNotAvailable
NotAvailableError creates a NotAvailable error
func (ErrNotAvailable) AddConsequence ¶
func (e ErrNotAvailable) AddConsequence(err error) error
AddConsequence adds an error 'err' to the list of consequences
type ErrNotFound ¶
type ErrNotFound struct {
ErrCore
}
ErrNotFound resource not found error
func NotFoundError ¶
func NotFoundError(msg string) ErrNotFound
NotFoundError creates a ErrNotFound error
func (ErrNotFound) AddConsequence ¶
func (e ErrNotFound) AddConsequence(err error) error
AddConsequence adds an error 'err' to the list of consequences
type ErrNotImplemented ¶
type ErrNotImplemented struct {
ErrCore
}
ErrNotImplemented ...
func NotImplementedError ¶
func NotImplementedError(what string) ErrNotImplemented
NotImplementedError creates a ErrNotImplemented error
func (ErrNotImplemented) AddConsequence ¶
func (e ErrNotImplemented) AddConsequence(err error) error
AddConsequence adds an error 'err' to the list of consequences
type ErrOverflow ¶
type ErrOverflow struct {
ErrCore
}
ErrOverflow ...
func OverflowError ¶
func OverflowError(msg string) ErrOverflow
OverflowError creates a ErrOverflow error
func (ErrOverflow) AddConsequence ¶
func (e ErrOverflow) AddConsequence(err error) error
AddConsequence adds an error 'err' to the list of consequences
type ErrOverload ¶
type ErrOverload struct {
ErrCore
}
ErrOverload when action cannot be honored because provider is overloaded (ie too many requests occured in a given time).
func OverloadError ¶
func OverloadError(msg string) ErrOverload
OverloadError creates a ErrOverload error
func (ErrOverload) AddConsequence ¶
func (e ErrOverload) AddConsequence(err error) error
AddConsequence adds an error 'err' to the list of consequences
type ErrRuntimePanic ¶
type ErrRuntimePanic struct {
ErrCore
}
ErrRuntimePanic ...
func RuntimePanicError ¶
func RuntimePanicError(msg string) ErrRuntimePanic
RuntimePanicError creates a ErrRuntimePanic error
type ErrTimeout ¶
type ErrTimeout struct { ErrCore // contains filtered or unexported fields }
ErrTimeout defines a Timeout error
func TimeoutError ¶
func TimeoutError(msg string, timeout time.Duration, cause error) ErrTimeout
TimeoutError ...
func (ErrTimeout) AddConsequence ¶
func (e ErrTimeout) AddConsequence(err error) error
AddConsequence adds an error 'err' to the list of consequences
type ErrUnauthorized ¶
type ErrUnauthorized struct {
}ErrUnauthorized when action is done without being authenticated first
func UnauthorizedError ¶
func UnauthorizedError(msg string) ErrUnauthorized
UnauthorizedError creates a ErrUnauthorized error
func (ErrUnauthorized) AddConsequence ¶
func (e ErrUnauthorized) AddConsequence(err error) error
AddConsequence adds an error 'err' to the list of consequences