Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HTTPResponseFromError ¶
func HTTPResponseFromError(err error) (*httpgrpc.HTTPResponse, bool)
HTTPResponseFromError converts an apiError into a JSON HTTP response
func IsAPIError ¶
IsAPIError returns true if the error provided is an apiError. This implies that HTTPResponseFromError will succeed.
func IsNonRetryableAPIError ¶
IsNonRetryableAPIError returns true if err is an apiError which should be failed and not retried.
Types ¶
type Type ¶
type Type string
const ( TypeNone Type = "" TypeTimeout Type = "timeout" TypeCanceled Type = "canceled" TypeExec Type = "execution" TypeBadData Type = "bad_data" TypeInternal Type = "internal" TypeNotFound Type = "not_found" TypeTooManyRequests Type = "too_many_requests" TypeTooLargeEntry Type = "too_large_entry" TypeNotAcceptable Type = "not_acceptable" )
adapted from https://github.com/prometheus/prometheus/blob/fdbc40a9efcc8197a94f23f0e479b0b56e52d424/web/api/v1/api.go#L67-L76
Click to show internal directories.
Click to hide internal directories.