api: automatically get errors in RawRequest
This commit is contained in:
parent
5202e8788d
commit
886812ecce
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue