getParsedResponse return resp if getResponse return error (#428)
getParsedResponse return resp if getResponse return error Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/428 Reviewed-by: techknowlogick <techknowlogick@gitea.io> Reviewed-by: John Olheiser <john.olheiser@gmail.com>
This commit is contained in:
parent
779e9330e9
commit
3226ac2e53
1 changed files with 1 additions and 1 deletions
|
@ -237,7 +237,7 @@ func (c *Client) getResponse(method, path string, header http.Header, body io.Re
|
||||||
func (c *Client) getParsedResponse(method, path string, header http.Header, body io.Reader, obj interface{}) (*Response, error) {
|
func (c *Client) getParsedResponse(method, path string, header http.Header, body io.Reader, obj interface{}) (*Response, error) {
|
||||||
data, resp, err := c.getResponse(method, path, header, body)
|
data, resp, err := c.getResponse(method, path, header, body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return resp, err
|
||||||
}
|
}
|
||||||
return resp, json.Unmarshal(data, obj)
|
return resp, json.Unmarshal(data, obj)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue