Skip to content

Commit

Permalink
fix: handle connection error
Browse files Browse the repository at this point in the history
  • Loading branch information
eynopv committed May 11, 2024
1 parent ae3a830 commit 18a8c21
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,13 @@ func (c *Client) Do(r *request.Request) (*result.Result, error) {
res, err := client.Do(request)
elapsedTime := time.Since(start)

if err != nil {
return nil, err
}

defer res.Body.Close()
body, err := io.ReadAll(res.Body)

if err != nil {
return nil, err
}
Expand Down

0 comments on commit 18a8c21

Please sign in to comment.