From 3c9645ff81e3f8fc72e2259d91de1c9e1be39e8c Mon Sep 17 00:00:00 2001 From: 6543 <6543@noreply.gitea.io> Date: Tue, 31 Mar 2020 11:19:18 +0000 Subject: [PATCH] On Internal Server Error, show request witch caused this (#296) On Internal Server Error, show request witch caused this Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: https://gitea.com/gitea/go-sdk/pulls/296 Reviewed-by: Lunny Xiao Reviewed-by: Andrew Thornton --- gitea/client.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gitea/client.go b/gitea/client.go index 133f11a..f431b0c 100644 --- a/gitea/client.go +++ b/gitea/client.go @@ -110,6 +110,8 @@ func (c *Client) getResponse(method, path string, header http.Header, body io.Re return nil, errors.New("409 Conflict") case 422: return nil, fmt.Errorf("422 Unprocessable Entity: %s", string(data)) + case 500: + return nil, fmt.Errorf("500 Internal Server Error, request: '%s' with '%s' method and '%s' header", path, method, header) } if resp.StatusCode/100 != 2 {