{"modulePath":"github.com/DirectXMan12/client-go","version":"v2.0.0+incompatible","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// StatusServerTimeout is an indication that a transient server error has\n\t// occurred and the client *should* retry, with an optional Retry-After\n\t// header to specify 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 unversioned.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 IsInternalError(err error) bool\n```\nIsInternalError determines if err is an error which indicates an internal server error.\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 NewNotFound.\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 IsTooManyRequests(err error) bool\n```\nIsTooManyRequests determines if err is an error which indicates that there are too many requests that the server cannot handle. TODO: update IsTooManyRequests() when the TooManyRequests(429) error returned from the API server has a non-empty Reason field\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 IsUnexpectedServerError(err error) bool\n```\nIsUnexpectedServerError returns true if the server response was not in the expected API format, and may be the result of another HTTP actor.\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 APIStatus interface {\n\tStatus() unversioned.Status\n}\n```\nAPIStatus is exposed by errors that can be converted to an api.Status object for finer grained details.\n\n```go\ntype StatusError struct {\n\tErrStatus unversioned.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 NewAlreadyExists(qualifiedResource unversioned.GroupResource, name string) *StatusError\n```\nNewAlreadyExists returns an error indicating the item requested exists by that identifier.\n\n```go\nfunc NewBadRequest(reason string) *StatusError\n```\nNewBadRequest creates an error that indicates that the request is invalid and can not be processed.\n\n```go\nfunc NewConflict(qualifiedResource unversioned.GroupResource, name string, err error) *StatusError\n```\nNewConflict returns an error indicating the item can't be updated as provided.\n\n```go\nfunc NewForbidden(qualifiedResource unversioned.GroupResource, name string, err error) *StatusError\n```\nNewForbidden returns an error indicating the requested action was forbidden\n\n```go\nfunc NewGenericServerResponse(code int, verb string, qualifiedResource unversioned.GroupResource, name, serverMessage string, retryAfterSeconds int, isUnexpectedResponse bool) *StatusError\n```\nNewGenericServerResponse returns a new error for server responses that are not in a recognizable form.\n\n```go\nfunc NewGone(message string) *StatusError\n```\nNewGone returns an error indicating the item no longer available at the server and no forwarding address is known.\n\n```go\nfunc NewInternalError(err error) *StatusError\n```\nNewInternalError returns an error indicating the item is invalid and cannot be processed.\n\n```go\nfunc NewInvalid(qualifiedKind unversioned.GroupKind, name string, errs field.ErrorList) *StatusError\n```\nNewInvalid returns an error indicating the item is invalid and cannot be processed.\n\n```go\nfunc NewMethodNotSupported(qualifiedResource unversioned.GroupResource, action string) *StatusError\n```\nNewMethodNotSupported returns an error indicating the requested action is not supported on this kind.\n\n```go\nfunc NewNotFound(qualifiedResource unversioned.GroupResource, name string) *StatusError\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(qualifiedResource unversioned.GroupResource, operation string, retryAfterSeconds int) *StatusError\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 NewServerTimeoutForKind(qualifiedKind unversioned.GroupKind, operation string, retryAfterSeconds int) *StatusError\n```\nNewServerTimeoutForKind should not exist.  Server timeouts happen when accessing resources, the Kind is just what we happened to be looking at when the request failed.  This delegates to keep code sane, but we should work towards removing this.\n\n```go\nfunc NewServiceUnavailable(reason string) *StatusError\n```\nNewServiceUnavailable creates an error that indicates that the requested service is unavailable.\n\n```go\nfunc NewTimeoutError(message string, retryAfterSeconds int) *StatusError\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) *StatusError\n```\nNewUnauthorized returns an error indicating the client is not authorized to perform the requested action.\n\n```go\nfunc (e *StatusError) DebugError() (string, []interface{})\n```\nDebugError reports extended info about the error to debug output.\n\n```go\nfunc (e *StatusError) Error() string\n```\nError implements the Error interface.\n\n```go\nfunc (e *StatusError) Status() unversioned.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/DirectXMan12/client-go/pkg/api/errors","name":"errors","synopsis":"Package errors provides detailed error types for api field validation.","isRedistributable":true}
