Merge pull request #13578 from WeiZhang555/errRet

return error when failed to read http response body
This commit is contained in:
Phil Estes 2015-05-29 16:57:27 -04:00
commit e5d2c5eb34

View file

@ -71,7 +71,7 @@ func (c *Client) callWithRetry(serviceMethod string, args interface{}, ret inter
if resp.StatusCode != http.StatusOK { if resp.StatusCode != http.StatusOK {
remoteErr, err := ioutil.ReadAll(resp.Body) remoteErr, err := ioutil.ReadAll(resp.Body)
if err != nil { if err != nil {
return nil return fmt.Errorf("Plugin Error: %s", err)
} }
return fmt.Errorf("Plugin Error: %s", remoteErr) return fmt.Errorf("Plugin Error: %s", remoteErr)
} }