errors

package
v0.1.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const ErrCodeContinueReconcileAndRequeue grovecorev1alpha1.ErrorCode = "ERR_CONTINUE_RECONCILE_AND_REQUEUE"

ErrCodeContinueReconcileAndRequeue is a special error code that indicates that the Sync of a current component errored, but the following components should be attempted to be synced, and then the current step should be re-queued after a certain time.

View Source
const ErrCodeRequeueAfter grovecorev1alpha1.ErrorCode = "ERR_REQUEUE_AFTER"

ErrCodeRequeueAfter is a special error code that indicates that the current step should be re-queued after a certain time,

Variables

View Source
var (
	// ErrMissingPodTemplateHashLabel is a sentinel error indicating that a pod is missing the pod-template-hash label.
	ErrMissingPodTemplateHashLabel = errors.New("missing pod template hash label")
)

Functions

func MapToLastErrors

func MapToLastErrors(errs []error) []grovecorev1alpha1.LastError

MapToLastErrors maps the given errors (that are GroveError's) to LastError slice.

func New

func New(code grovecorev1alpha1.ErrorCode, operation string, message string) error

New creates a new GroveError with the given error code, operation and message. This function should be used to create a new error. If you wish to wrap an existing error then use WrapError instead.

func WrapError

func WrapError(err error, code grovecorev1alpha1.ErrorCode, operation string, message string) error

WrapError wraps the given error with the provided error code, operation and message. If the err is nil then it returns nil.

Types

type GroveError

type GroveError struct {
	// Code indicates the category of error.
	Code grovecorev1alpha1.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
}

GroveError is a custom error type that should be used throughout grove which encapsulates the underline error (cause), uniquely identifiable error code, contextual information captured as operation during which an error occurred and any custom message.

func (*GroveError) Error

func (e *GroveError) Error() string

Jump to

Keyboard shortcuts

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