api: automatically get errors in RawRequest

This commit is contained in:
Mitchell Hashimoto 2015-03-11 19:46:07 +01:00
parent 5202e8788d
commit 886812ecce
1 changed files with 6 additions and 1 deletions

View File

@ -78,5 +78,10 @@ func (c *Client) RawRequest(r *Request) (*Response, error) {
return nil, err
}
return &Response{Response: resp}, nil
result := &Response{Response: resp}
if err := result.Error(); err != nil {
return nil, err
}
return result, nil
}