Documentation ¶
Index ¶
- Variables
- func CheckErrorf(format string, a ...interface{}) error
- func CheckResponseStatus(resp *http.Response, expectedStatusCodes ...int) error
- func CheckResponseStatusWithBody(resp *http.Response, body []byte, expectedStatusCodes ...int) error
- func GenerateResponseError(status, body string) error
- type OnErrorHandler
Constants ¶
This section is empty.
Variables ¶
View Source
var CheckError = func(err error) error {
return err
}
Functions ¶
func CheckErrorf ¶ added in v1.6.1
func CheckResponseStatus ¶ added in v0.2.2
Check expected status codes and return error if needed
func CheckResponseStatusWithBody ¶ added in v1.18.1
func CheckResponseStatusWithBody(resp *http.Response, body []byte, expectedStatusCodes ...int) error
Check expected status codes and return error with body if needed We use body variable that was saved outside the resp.body object, Instead of resp.Body because resp.body disappears after resp.body.Close()
func GenerateResponseError ¶ added in v0.27.0
Types ¶
type OnErrorHandler ¶
Error modes (how should the application behave when the CheckError function is invoked):
Click to show internal directories.
Click to hide internal directories.