check error
This commit is contained in:
parent
28437325f9
commit
ae28c4911f
1 changed files with 4 additions and 0 deletions
|
@ -53,6 +53,10 @@ func (c *client) makeRequest(endpoint string, into interface{}) error {
|
|||
client := http.Client{}
|
||||
resp, err := client.Do(req)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if resp.StatusCode != http.StatusOK {
|
||||
return errors.New("non 2xx response")
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue