Documentation ¶
Index ¶
Constants ¶
const ErrRequeueAfter = "ERR_REQUEUE_AFTER"
ErrRequeueAfter is a special error code that indicates that the current step should be re-queued after a certain time, as some conditions during reconciliation are not met. This should not be used in case there is an actual error during reconciliation.
Variables ¶
This section is empty.
Functions ¶
func MapToLastErrors ¶
func MapToLastErrors(errs []error) []druidv1alpha1.LastError
MapToLastErrors maps a slice of DruidError's and maps these to druidv1alpha1.LastError slice which will be set in the status of an etcd resource.
func New ¶
func New(code druidv1alpha1.ErrorCode, operation string, message string) error
New creates a new DruidError with the given error code, operation and message.
Types ¶
type DruidError ¶
type DruidError struct { // Code indicates the category of error adding contextual information to the underline error. Code druidv1alpha1.ErrorCode // Cause is the underline error. Cause error // Operation is the semantic operation during which this error is created/wrapped. Operation string // Message is the custom message providing additional context for the error. Message string // ObservedAt is the time at which the error was observed. ObservedAt time.Time }
DruidError is a custom error that should be used throughout druid which encapsulates the underline error (cause) along with error code and contextual information captured as operation during which an error occurred and any custom message.
func AsDruidError ¶ added in v0.23.1
func AsDruidError(err error) *DruidError
AsDruidError returns the given error as a DruidError if it is of type DruidError, otherwise returns nil.
func (*DruidError) Error ¶
func (e *DruidError) Error() string
func (*DruidError) WithCause ¶
func (e *DruidError) WithCause(err error) error
WithCause sets the underline error and returns the DruidError.