From 3226ac2e537bd1cf7e12d792e259ea3385dbc657 Mon Sep 17 00:00:00 2001 From: 6543 <6543@noreply.gitea.io> Date: Tue, 29 Sep 2020 14:19:31 +0000 Subject: [PATCH] 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 Reviewed-by: John Olheiser --- gitea/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gitea/client.go b/gitea/client.go index 6513076..ecf5d13 100644 --- a/gitea/client.go +++ b/gitea/client.go @@ -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) { data, resp, err := c.getResponse(method, path, header, body) if err != nil { - return nil, err + return resp, err } return resp, json.Unmarshal(data, obj) }