Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckResponse ¶
CheckResponse creates a new instance of T given an error and http.Response returned by an http request operation (e.g. Get, Do etc). If err is nil, resp must not be nil. It will return nil if err is nil and resp.StatusCode is http.StatusOK. Otherwise, it will create an instance of httperror.T with the appropriate fields set.
func CheckResponseRetries ¶
CheckResponseRetries is like Checkresponse but will set the retries field.
func IsHTTPError ¶
IsHTTPError returns true if err contains the specified http status code.
Types ¶
type T ¶
T represents an error encountered while making an HTTP request of some form. The error may be the result of a failed local operation (in which case Err will be non-nil), or an error returned by the remote server (in which case Err will be nil but StatusCode will something other than http.StatusOK). In all cases, Err or StatusCode must contain an error.