errors

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Is checks whether the given error matches a target error.
	Is = errors.Is
	// As casts the given error to a target type.
	As = errors.As
	// Join combines multiple errors into a single error.
	Join = errors.Join
)
View Source
var (
	// IsNotFound checks whether the given error is a Kubernetes not found
	// error.
	IsNotFound = kerrors.IsNotFound

	// IsAlreadyExists checks whether the given error is a Kubernetes already
	// exists error.
	IsAlreadyExists = kerrors.IsAlreadyExists

	// IsConflict checks whether the given error is a Kubernetes conflict
	// error.
	IsConflict = kerrors.IsConflict

	// IsInvalid checks whether the given error is a Kubernetes invalid error.
	IsInvalid = kerrors.IsInvalid

	// IsGone checks whether the given error is a Kubernetes gone error.
	IsGone = kerrors.IsGone

	// IsResourceExpired checks whether the given error is a Kubernetes
	// resource expired error.
	IsResourceExpired = kerrors.IsResourceExpired

	// IsNotAcceptable checks whether the given error is a Kubernetes not
	// acceptable error.
	IsNotAcceptable = kerrors.IsNotAcceptable

	// IsUnsupportedMediaType checks whether the given error is a Kubernetes
	// unsupported media type error.
	IsUnsupportedMediaType = kerrors.IsUnsupportedMediaType

	// IsMethodNotSupported checks whether the given error is a Kubernetes
	// method not supported error.
	IsMethodNotSupported = kerrors.IsMethodNotSupported

	// IsServiceUnavailable checks whether the given error is a Kubernetes
	// service unavailable error.
	IsServiceUnavailable = kerrors.IsServiceUnavailable

	// IsBadRequest checks whether the given error is a Kubernetes bad request
	// error.
	IsBadRequest = kerrors.IsBadRequest

	// IsUnauthorized checks whether the given error is a Kubernetes
	// unauthorized error.
	IsUnauthorized = kerrors.IsUnauthorized

	// IsForbidden checks whether the given error is a Kubernetes forbidden
	// error.
	IsForbidden = kerrors.IsForbidden

	// IsTimeout checks whether the given error is a Kubernetes timeout error.
	IsTimeout = kerrors.IsTimeout

	// IsServerTimeout checks whether the given error is a Kubernetes server
	// timeout error.
	IsServerTimeout = kerrors.IsServerTimeout

	// IsInternalError checks whether the given error is a Kubernetes internal
	// error.
	IsInternalError = kerrors.IsInternalError

	// IsTooManyRequests checks whether the given error is a Kubernetes too
	// many requests error.
	IsTooManyRequests = kerrors.IsTooManyRequests

	// IsRequestEntityTooLargeError checks whether the given error is a
	// Kubernetes request entity too large error.
	IsRequestEntityTooLargeError = kerrors.IsRequestEntityTooLargeError

	// IsUnexpectedServerError checks whether the given error is a Kubernetes
	// unexpected server error.
	IsUnexpectedServerError = kerrors.IsUnexpectedServerError

	// IsUnexpectedObjectError checks whether the given error is a Kubernetes
	// unexpected object error.
	IsUnexpectedObjectError = kerrors.IsUnexpectedObjectError

	// IsStoreReadError checks whether the given error is a Kubernetes store
	// read error.
	IsStoreReadError = kerrors.IsStoreReadError
)

Kubernetes error checkers.

Functions

This section is empty.

Types

type Error

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

Error is an abstract error type wrapping a given error.

func New

func New(msg string) *Error

New creates a new wrapped error type with the given error message.

func Wrap

func Wrap(err error) *Error

Wrap creates a wrapped error type with the given base error.

func (*Error) As

func (e *Error) As(target any) bool

As casts the underlying error to a target type.

func (*Error) Error

func (e *Error) Error() string

Error returns the error message of the underlying error.

func (*Error) Is

func (e *Error) Is(target error) bool

Is compares the underlying error with a target error.

func (*Error) New

func (e *Error) New(msg string, args ...any) error

New creates a new specific error instance of the underlying error. The error message is created by formatting the given message and arguments appending it separated by a hyphen to the underlying error.

func (*Error) String

func (e *Error) String() string

String returns the string representation of the underlying error.

func (*Error) Unwrap

func (e *Error) Unwrap() error

Unwrap unwraps the underlying error.

func (*Error) Wrap

func (e *Error) Wrap(msg string, args ...any) error

Wrap is a convenience method that wraps a given error instance using the underlying error. If no error is provided as final argument, it returns nil.

Jump to

Keyboard shortcuts

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