This commit is contained in:
Tan Jiang 2017-07-14 14:53:12 +08:00
parent 72b3a020e3
commit 771e26a188

View File

@ -57,7 +57,7 @@ func (c *Client) send(req *http.Request, expectedStatus int) ([]byte, error) {
if err != nil {
return nil, err
}
if resp.StatusCode != http.StatusOK {
if resp.StatusCode != expectedStatus {
return nil, fmt.Errorf("Unexpected status code: %d, text: %s", resp.StatusCode, string(b))
}
return b, nil