diff --git a/libs/client.go b/libs/client.go index 3c6ca45..d5d527c 100644 --- a/libs/client.go +++ b/libs/client.go @@ -187,6 +187,15 @@ func (c Client) makeRequest() ([]byte, error) { return nil, ErrUnAuthorized } + if res.StatusCode == http.StatusBadRequest { + body, _ := io.ReadAll(res.Body) + bodyStr := string(body) + errMsg := fmt.Sprintf("bad request: %s", bodyStr) + + gologger.Error().Msg(errMsg) + return nil, errors.New(errMsg) + } + resBody, err := io.ReadAll(res.Body) if err != nil { return nil, err