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 GenerateErrorString(bodyArray []byte) string
- 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 ¶
func CheckResponseStatus ¶
Check expected status codes and return error if needed
func CheckResponseStatusWithBody ¶
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 GenerateErrorString ¶
func GenerateResponseError ¶
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.