Documentation
¶
Overview ¶
Package errors contains useful functionality for conversion errors
Index ¶
- Variables
- func AsAPIError(err error) error
- func AsStatusCode(err error) int
- func AsStatusError(response *resty.Response, grs ...schema.GroupResource) error
- func ConvertKnativeFieldErrorToErrorList(err *apis.FieldError) field.ErrorList
- func ConvertKnativeFieldErrorToInternalError(err *apis.FieldError) *field.Error
- func ConvertResponseError(ctx context.Context, response *http.Response, err error, ...) error
- func GVKToGVR(gvk schema.GroupVersionKind) (gr schema.GroupVersionResource)
- func HandleError(req *restful.Request, resp *restful.Response, err error)
- func IsTemporaryError(err error) bool
- type TemporaryError
Constants ¶
This section is empty.
Variables ¶
var ErrNilPointer = errors.New("nil pointer")
ErrNilPointer indicates nil pointer, avoid panic. Although unlikely just in case
var RESTClientGroupResource = schema.GroupResource{Group: "katanomi.dev", 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 ConvertKnativeFieldErrorToErrorList ¶
func ConvertKnativeFieldErrorToErrorList(err *apis.FieldError) field.ErrorList
func ConvertKnativeFieldErrorToInternalError ¶
func ConvertKnativeFieldErrorToInternalError(err *apis.FieldError) *field.Error
func ConvertResponseError ¶ added in v0.3.0
func ConvertResponseError(ctx context.Context, response *http.Response, err error, gvk schema.GroupVersionKind, names ...string) error
ConvertResponseError converts a gitlab response and an error into a kubernetes api error ctx is the basic context, response is the response object from gitlab sdk, err is the returned error gvk is the GroupVersionKind object with type meta for the object names supports one optional name to be given and will be attributed as the resource name in the returned error
func GVKToGVR ¶ added in v0.7.0
func GVKToGVR(gvk schema.GroupVersionKind) (gr schema.GroupVersionResource)
GVKToGVR convert schema GroupVersionKind to GroupVersionResource Warning: this function just for show error info
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