check error

This commit is contained in:
Daniel Ponte 2023-02-27 18:44:01 -05:00
parent 28437325f9
commit ae28c4911f

View file

@ -53,6 +53,10 @@ func (c *client) makeRequest(endpoint string, into interface{}) error {
client := http.Client{} client := http.Client{}
resp, err := client.Do(req) resp, err := client.Do(req)
if err != nil {
return err
}
if resp.StatusCode != http.StatusOK { if resp.StatusCode != http.StatusOK {
return errors.New("non 2xx response") return errors.New("non 2xx response")
} }