From 136185be680124e6f2b74e68dd3a419afa5fe24b Mon Sep 17 00:00:00 2001 From: qwerty287 Date: Sat, 20 Jul 2024 09:41:06 +0000 Subject: [PATCH] Exclude headers from error --- forgejo/client.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/forgejo/client.go b/forgejo/client.go index 35fa6ac..80c8e46 100644 --- a/forgejo/client.go +++ b/forgejo/client.go @@ -414,8 +414,7 @@ func statusCodeToErr(resp *Response) (body []byte, err error) { // plain string, so we try to return a helpful error anyway path := resp.Request.URL.Path method := resp.Request.Method - header := resp.Request.Header - return data, fmt.Errorf("unknown API Error: %d\nRequest: '%s' with '%s' method '%s' header and '%s' body", resp.StatusCode, path, method, header, string(data)) + return data, fmt.Errorf("unknown API Error: %d\nRequest: '%s' with '%s' method and '%s' body", resp.StatusCode, path, method, string(data)) } if msg, ok := errMap["message"]; ok {