Stop SIGSEGV on test dial not reachable

Signed-off-by: John Howard <jhoward@microsoft.com>
This commit is contained in:
John Howard 2015-07-22 16:01:32 -07:00
parent f218192754
commit 09b86c46b8

View file

@ -338,11 +338,9 @@ func sockRequest(method, endpoint string, data interface{}) (int, []byte, error)
res, body, err := sockRequestRaw(method, endpoint, jsonData, "application/json")
if err != nil {
b, _ := ioutil.ReadAll(body)
return -1, b, err
return -1, nil, err
}
var b []byte
b, err = readBody(body)
b, err := readBody(body)
return res.StatusCode, b, err
}