Documentation ¶
Index ¶
- func NewAlreadyExists(kind, name string) error
- func NewBadRequest(msg string, options ...interface{}) error
- func NewConflict(kind, dc, name string) error
- func NewFromKubernetesError(err error) error
- func NewNotAuthorized() error
- func NewNotFound(kind, name string) error
- func NewNotImplemented() error
- func NewWrongMethod(got, want interface{}) error
- type Aggregate
- type HTTPError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAlreadyExists ¶
NewAlreadyExists creates a HTTP 409 already exists error.
func NewBadRequest ¶
NewBadRequest creates a HTTP 400 error.
func NewConflict ¶
NewConflict creates a HTTP 409 error for a kind in a datacenter.
func NewFromKubernetesError ¶ added in v2.22.0
NewFromKubernetesError constructs HTTPError only if the given err is of type *StatusError. Otherwise unmodified err will be returned to the caller.
func NewNotFound ¶
NewNotFound creates a HTTP 404 error for a kind.
func NewNotImplemented ¶
func NewNotImplemented() error
NewNotImplemented creates a HTTP 501 'not implemented' error.
func NewWrongMethod ¶ added in v2.19.0
func NewWrongMethod(got, want interface{}) error
NewWrongMethod creates a HTTP 400 error, if we got a wrong request type.
Types ¶
type Aggregate ¶
Aggregate represents an object that contains multiple errors, but does not necessarily have singular semantic meaning.
func NewAggregate ¶
NewAggregate converts a slice of errors into an Aggregate interface, which is itself an implementation of the error interface. If the slice is empty, this returns nil. It will check if any of the element of input error list is nil, to avoid nil pointer panic when call Error().
type HTTPError ¶
type HTTPError struct {
// contains filtered or unexported fields
}
HTTPError represents an HTTP server error.
func NewWithDetails ¶
NewWithDetails creates a brand new HTTPError object.
func (HTTPError) StatusCode ¶
StatusCode returns the status code for the error.