return error when failed to read http response body

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
Upstream-commit: de225b5d130f40189297e12ceb1593949ca24219
Component: engine
This commit is contained in:
Zhang Wei
2015-05-29 12:52:51 +08:00
parent fd72895a8e
commit 49406310ca
+1 -1
View File
@@ -71,7 +71,7 @@ func (c *Client) callWithRetry(serviceMethod string, args interface{}, ret inter
if resp.StatusCode != http.StatusOK {
remoteErr, err := ioutil.ReadAll(resp.Body)
if err != nil {
return nil
return fmt.Errorf("Plugin Error: %s", err)
}
return fmt.Errorf("Plugin Error: %s", remoteErr)
}