From a0e7dc03a252a0e9860bb63aac669063df78ab8f Mon Sep 17 00:00:00 2001 From: Zhang Wei Date: Fri, 29 May 2015 12:51:51 +0800 Subject: [PATCH] return error when failed to read http response body Signed-off-by: Zhang Wei --- plugins/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/client.go b/plugins/client.go index d531fa4..cd1d3ac 100644 --- a/plugins/client.go +++ b/plugins/client.go @@ -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) }