Documentation ¶
Index ¶
- Constants
- func IsNotFoundError(err error) bool
- func IsTemporaryError(err error) bool
- func UnwrapAll(err error) error
- func UnwrapOnce(err error) (cause error)
- type ErrComponent
- type ErrReason
- type ErrorReporter
- type LastError
- func (err LastError) Component() ErrComponent
- func (err LastError) Error() string
- func (err LastError) Reason() ErrReason
- func (err LastError) SetComponent(component ErrComponent) LastError
- func (err LastError) SetMessage(msg string) LastError
- func (err LastError) SetReason(reason ErrReason) LastError
- type NotFoundError
- type TemporaryError
- type WrapTemporaryError
Constants ¶
View Source
const OperationTimeOutMsg string = "operation has reached the time limit"
Variables ¶
This section is empty.
Functions ¶
func IsNotFoundError ¶
func IsTemporaryError ¶
func UnwrapAll ¶
UnwrapAll accesses the root cause object of the error. If the error has no cause (leaf error), it is returned directly. this is a replacement for github.com/pkg/errors.Cause
func UnwrapOnce ¶
UnwrapOnce accesses the direct cause of the error if any, otherwise returns nil.
Types ¶
type ErrComponent ¶
type ErrComponent string
const ( ErrDB ErrComponent = "db - keb" ErrK8SClient ErrComponent = "k8s client - keb" ErrKEB ErrComponent = "keb" ErrEDP ErrComponent = "edp" ErrProvisioner ErrComponent = "provisioner" ErrReconciler ErrComponent = "reconciler" ErrAVS ErrComponent = "avs" )
type ErrReason ¶
type ErrReason string
const ( ErrKEBInternal ErrReason = "err_keb_internal" ErrKEBTimeOut ErrReason = "err_keb_timeout" ErrProvisionerNilLastError ErrReason = "err_provisioner_nil_last_error" ErrHttpStatusCode ErrReason = "err_http_status_code" ErrReconcilerNilFailures ErrReason = "err_reconciler_nil_failures" ErrClusterNotFound ErrReason = "err_cluster_not_found" ErrK8SUnexpectedServerError ErrReason = "err_k8s_unexpected_server_error" ErrK8SUnexpectedObjectError ErrReason = "err_k8s_unexpected_object_error" ErrK8SNoMatchError ErrReason = "err_k8s_no_match_error" ErrK8SAmbiguousError ErrReason = "err_k8s_ambiguous_error" )
type ErrorReporter ¶
type ErrorReporter interface { error Reason() ErrReason Component() ErrComponent }
type LastError ¶
type LastError struct {
// contains filtered or unexported fields
}
error reporter
func TimeoutError ¶
func (LastError) Component ¶
func (err LastError) Component() ErrComponent
func (LastError) SetComponent ¶
func (err LastError) SetComponent(component ErrComponent) LastError
func (LastError) SetMessage ¶
type NotFoundError ¶
type NotFoundError struct { }
func (NotFoundError) Component ¶
func (NotFoundError) Component() ErrComponent
func (NotFoundError) Error ¶
func (NotFoundError) Error() string
func (NotFoundError) IsNotFound ¶
func (NotFoundError) IsNotFound() bool
func (NotFoundError) Reason ¶
func (NotFoundError) Reason() ErrReason
type TemporaryError ¶
type TemporaryError struct {
// contains filtered or unexported fields
}
func AsTemporaryError ¶
func AsTemporaryError(err error, context string, args ...interface{}) *TemporaryError
func NewTemporaryError ¶
func NewTemporaryError(msg string, args ...interface{}) *TemporaryError
func (TemporaryError) Component ¶
func (TemporaryError) Component() ErrComponent
func (TemporaryError) Error ¶
func (te TemporaryError) Error() string
func (TemporaryError) Reason ¶
func (TemporaryError) Reason() ErrReason
func (TemporaryError) Temporary ¶
func (TemporaryError) Temporary() bool
type WrapTemporaryError ¶
type WrapTemporaryError struct {
// contains filtered or unexported fields
}
can be used for temporary error but still storing the original error in case returned to Execute
func WrapAsTemporaryError ¶
func WrapAsTemporaryError(err error, msg string, args ...interface{}) *WrapTemporaryError
func WrapNewTemporaryError ¶
func WrapNewTemporaryError(err error) *WrapTemporaryError
func (WrapTemporaryError) Component ¶
func (wte WrapTemporaryError) Component() ErrComponent
func (WrapTemporaryError) Error ¶
func (te WrapTemporaryError) Error() string
func (WrapTemporaryError) Reason ¶
func (wte WrapTemporaryError) Reason() ErrReason
func (WrapTemporaryError) Temporary ¶
func (WrapTemporaryError) Temporary() bool
Click to show internal directories.
Click to hide internal directories.