fix: billing status code check

This commit is contained in:
ckt1031
2023-07-10 23:15:30 +08:00
parent 4b2cb573b6
commit 67b8e82457
2 changed files with 4 additions and 1 deletions

View File

@@ -96,6 +96,9 @@ func GetResponseBody(method, url string, channel *model.Channel, headers http.He
if err != nil {
return nil, err
}
if res.StatusCode != http.StatusOK {
return nil, fmt.Errorf("status code: %d", res.StatusCode)
}
body, err := io.ReadAll(res.Body)
if err != nil {
return nil, err