errors

package
v0.0.0-...-b7f4efd Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Severe  = Severity("severe")
	Warning = Severity("warning")
)

Variables

This section is empty.

Functions

func FromDoRequestError

func FromDoRequestError(req *http.Request, err error) error

func FromNewRequestError

func FromNewRequestError(method, url string, err error) error

func FromResponse

func FromResponse(resp *http.Response) error

func IgnoreNotFound

func IgnoreNotFound(err error) error

func IsBadRequest

func IsBadRequest(err error) bool

func IsNetworkError

func IsNetworkError(err error) bool

func IsNotFound

func IsNotFound(err error) bool

func IsRecoverable

func IsRecoverable(err error) bool

func IsServerError

func IsServerError(err error) bool

func IsUnauthorized

func IsUnauthorized(err error) bool

func NewContextError

func NewContextError(err error) error

func NewNotFoundError

func NewNotFoundError() error

func NewUnrecoverableError

func NewUnrecoverableError(message string) error

Types

type AdmissionError

type AdmissionError struct {
	Severity Severity
	Message  string
}

func NewSevere

func NewSevere(message string) *AdmissionError

func NewSeveref

func NewSeveref(format string, args ...any) *AdmissionError

func NewWarning

func NewWarning(message string) *AdmissionError

func NewWarningf

func NewWarningf(format string, args ...any) *AdmissionError

func (*AdmissionError) Error

func (err *AdmissionError) Error() string

type AdmissionErrors

type AdmissionErrors struct {
	Warning []*AdmissionError
	Severe  []*AdmissionError
}

func NewAdmissionErrors

func NewAdmissionErrors() *AdmissionErrors

func (*AdmissionErrors) Add

func (errs *AdmissionErrors) Add(err *AdmissionError)

func (*AdmissionErrors) AddSevere

func (errs *AdmissionErrors) AddSevere(message string)

func (*AdmissionErrors) AddSeveref

func (errs *AdmissionErrors) AddSeveref(format string, args ...any)

func (*AdmissionErrors) AddWarning

func (errs *AdmissionErrors) AddWarning(message string)

func (*AdmissionErrors) AddWarningf

func (errs *AdmissionErrors) AddWarningf(format string, args ...any)

func (*AdmissionErrors) IsSevere

func (errs *AdmissionErrors) IsSevere() bool

func (*AdmissionErrors) Map

func (errs *AdmissionErrors) Map() (admission.Warnings, error)

func (*AdmissionErrors) MergeWith

func (errs *AdmissionErrors) MergeWith(other *AdmissionErrors)

type ContextError

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

func (ContextError) Is

func (e ContextError) Is(err error) bool

Redirects the behavior of Is to As because Is is not implemented for k8s.io errors aggregate.

type ServerError

type ServerError struct {
	StatusCode int    `json:"status"`
	URL        string `json:"url"`
	Method     string `json:"method"`
	Message    string `json:"message"`
	Body       string `json:"body"`
}

func NewServerError

func NewServerError(resp *http.Response) ServerError

func (ServerError) Error

func (err ServerError) Error() string

func (ServerError) IsRecoverable

func (err ServerError) IsRecoverable() bool

type Severity

type Severity string

type UnrecoverableError

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

func (UnrecoverableError) Error

func (err UnrecoverableError) Error() string

Jump to

Keyboard shortcuts

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