{"modulePath":"github.com/composit/kubernetes","version":"v0.14.2","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package errors\n\nPackage errors provides detailed error types for api field validation.\n\n## Constants\n\n```go\nconst (\n\tStatusUnprocessableEntity = 422\n\tStatusTooManyRequests     = 429\n\t// HTTP recommendations are for servers to define 5xx error codes\n\t// for scenarios not covered by behavior. In this case, ServerTimeout\n\t// is an indication that a transient server error has occured and the\n\t// client *should* retry, with an optional Retry-After header to specify\n\t// the back off window.\n\tStatusServerTimeout = 504\n)\n```\nHTTP Status codes not in the golang http package.\n\n## Functions\n\n```go\nfunc FromObject(obj runtime.Object) error\n```\nFromObject generates an StatusError from an api.Status, if that is the type of obj; otherwise, returns an UnexpecteObjectError.\n\n```go\nfunc IsAlreadyExists(err error) bool\n```\nIsAlreadyExists determines if the err is an error which indicates that a specified resource already exists.\n\n```go\nfunc IsBadRequest(err error) bool\n```\nIsBadRequest determines if err is an error which indicates that the request is invalid.\n\n```go\nfunc IsConflict(err error) bool\n```\nIsConflict determines if the err is an error which indicates the provided update conflicts.\n\n```go\nfunc IsForbidden(err error) bool\n```\nIsForbidden determines if err is an error which indicates that the request is forbidden and cannot be completed as requested.\n\n```go\nfunc IsInvalid(err error) bool\n```\nIsInvalid determines if the err is an error which indicates the provided resource is not valid.\n\n```go\nfunc IsMethodNotSupported(err error) bool\n```\nIsMethodNotSupported determines if the err is an error which indicates the provided action could not be performed because it is not supported by the server.\n\n```go\nfunc IsNotFound(err error) bool\n```\nIsNotFound returns true if the specified error was created by NewNotFoundErr.\n\n```go\nfunc IsServerTimeout(err error) bool\n```\nIsServerTimeout determines if err is an error which indicates that the request needs to be retried by the client.\n\n```go\nfunc IsStatusError(err error) bool\n```\nIsStatusError determines if err is an API Status error received from the master.\n\n```go\nfunc IsUnauthorized(err error) bool\n```\nIsUnauthorized determines if err is an error which indicates that the request is unauthorized and requires authentication by the user.\n\n```go\nfunc IsUnexpectedObjectError(err error) bool\n```\nIsUnexpectedObjectError determines if err is due to an unexpected object from the master.\n\n```go\nfunc NewAlreadyExists(kind, name string) error\n```\nNewAlreadyExists returns an error indicating the item requested exists by that identifier.\n\n```go\nfunc NewBadRequest(reason string) error\n```\nNewBadRequest creates an error that indicates that the request is invalid and can not be processed.\n\n```go\nfunc NewConflict(kind, name string, err error) error\n```\nNewConflict returns an error indicating the item can't be updated as provided.\n\n```go\nfunc NewForbidden(kind, name string, err error) error\n```\nNewForbidden returns an error indicating the requested action was forbidden\n\n```go\nfunc NewInternalError(err error) error\n```\nNewInternalError returns an error indicating the item is invalid and cannot be processed.\n\n```go\nfunc NewInvalid(kind, name string, errs fielderrors.ValidationErrorList) error\n```\nNewInvalid returns an error indicating the item is invalid and cannot be processed.\n\n```go\nfunc NewMethodNotSupported(kind, action string) error\n```\nNewMethodNotSupported returns an error indicating the requested action is not supported on this kind.\n\n```go\nfunc NewNotFound(kind, name string) error\n```\nNewNotFound returns a new error which indicates that the resource of the kind and the name was not found.\n\n```go\nfunc NewServerTimeout(kind, operation string, retryAfterSeconds int) error\n```\nNewServerTimeout returns an error indicating the requested action could not be completed due to a transient error, and the client should try again.\n\n```go\nfunc NewTimeoutError(message string, retryAfterSeconds int) error\n```\nNewTimeoutError returns an error indicating that a timeout occurred before the request could be completed.  Clients may retry, but the operation may still complete.\n\n```go\nfunc NewUnauthorized(reason string) error\n```\nNewUnauthorized returns an error indicating the client is not authorized to perform the requested action.\n\n```go\nfunc SuggestsClientDelay(err error) (int, bool)\n```\nSuggestsClientDelay returns true if this error suggests a client delay as well as the suggested seconds to wait, or false if the error does not imply a wait.\n\n## Types\n\n```go\ntype StatusError struct {\n\tErrStatus api.Status\n}\n```\nStatusError is an error intended for consumption by a REST API server; it can also be reconstructed by clients from a REST response. Public to allow easy type switches.\n\n```go\nfunc (e *StatusError) Error() string\n```\nError implements the Error interface.\n\n```go\nfunc (e *StatusError) Status() api.Status\n```\nStatus allows access to e's status without having to know the detailed workings of StatusError. Used by pkg/apiserver.\n\n```go\ntype UnexpectedObjectError struct {\n\tObject runtime.Object\n}\n```\nUnexpectedObjectError can be returned by FromObject if it's passed a non-status object.\n\n```go\nfunc (u *UnexpectedObjectError) Error() string\n```\nError returns an error message describing 'u'.\n\n","path":"github.com/composit/kubernetes/pkg/api/errors","name":"errors","synopsis":"Package errors provides detailed error types for api field validation.","isRedistributable":true}
