Several small fixes.

This commit is contained in:
Brendan Burns
2014-06-24 14:57:09 -07:00
parent 20ba523266
commit 84e5c37f74
5 changed files with 95 additions and 4 deletions

View File

@@ -106,7 +106,11 @@ func (c *Client) doRequest(request *http.Request) ([]byte, error) {
if response.StatusCode == http.StatusAccepted {
var status api.Status
if err := api.DecodeInto(body, &status); err == nil {
return nil, &StatusErr{status}
if status.Status == api.StatusSuccess {
return body, nil
} else {
return nil, &StatusErr{status}
}
}
// Sometimes the server returns 202 even though it completely handled the request.
}