Documentation
¶
Overview ¶
Package errors provides a set of error functions
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNilPointer = errors.New("nil pointer")
ErrNilPointer indicates nil pointer, avoid panic. Although unlikely just in case
var RESTAPIGroupResource = schema.GroupResource{Group: "alauda.io", Resource: "API"}
RESTAPIGroupResource fake GroupResource to use errors api
var RESTClientGroupResource = schema.GroupResource{Group: "alauda.io", Resource: "RESTfulClient"}
RESTClientGroupResource fake GroupResource to use errors api
Functions ¶
func AsAPIError ¶
AsAPIError returns an error as a apimachinary api error
func AsStatusCode ¶
AsStatusCode returns the code from a errors.APIStatus, if not compatible will return InternalServerError
func AsStatusError ¶
func AsStatusError(response *resty.Response, grs ...schema.GroupResource) error
AsStatusError transform resty response to status error
func HandleError ¶
HandleError handles error in requests
func IsTemporaryError ¶
IsTemporaryError this will check against a list of know non-temporary related errors like 403-Forbidden etc all others will be considered to be temporary
Types ¶
type TemporaryError ¶
TemporaryError is an error and has a Temporary function