errors

package
v0.0.0-...-bfb696a Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

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 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 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"`
}

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 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