fix: billing status code check
This commit is contained in:
parent
4b2cb573b6
commit
67b8e82457
@ -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
|
||||
|
@ -55,7 +55,7 @@ func testChannel(channel *model.Channel, request ChatRequest) error {
|
||||
return err
|
||||
}
|
||||
|
||||
if resp.StatusCode != 200 {
|
||||
if resp.StatusCode != http.StatusOK {
|
||||
return errors.New("invalid status code: " + strconv.Itoa(resp.StatusCode))
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user