From fdcfe5358a7830deab40a4fce0b6e0a9a6b9ce38 Mon Sep 17 00:00:00 2001 From: Raul Date: Mon, 20 Mar 2023 12:22:13 +0100 Subject: [PATCH] improve check status 500 --- gfw/api/client.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gfw/api/client.go b/gfw/api/client.go index bb8d6ee..2436502 100644 --- a/gfw/api/client.go +++ b/gfw/api/client.go @@ -62,6 +62,8 @@ func (c *GFWClient) doRequest(req *http.Request) ([]byte, error) { if res.StatusCode >= 500 { if err != nil { return nil, err + } else { + return nil, fmt.Errorf("Error %d: %s", res.StatusCode, string(body)) } } if res.StatusCode >= 300 && res.StatusCode < 500 {