This commit is contained in:
Yuzuki999
2022-12-24 02:44:09 +08:00
parent b07c9f0b6b
commit 2f223e173f

View File

@@ -23,7 +23,7 @@ func (c *Client) checkResponse(res *resty.Response, path string, err error) erro
if err != nil { if err != nil {
return fmt.Errorf("request %s failed: %s", c.assembleURL(path), err) return fmt.Errorf("request %s failed: %s", c.assembleURL(path), err)
} }
if res.StatusCode() > 400 { if res.StatusCode() != 200 {
body := res.Body() body := res.Body()
return fmt.Errorf("request %s failed: %s, %s", c.assembleURL(path), string(body), err) return fmt.Errorf("request %s failed: %s, %s", c.assembleURL(path), string(body), err)
} }