Skip to content

Commit

Permalink
single if
Browse files Browse the repository at this point in the history
  • Loading branch information
vtopc committed Oct 29, 2024
1 parent e5adcc5 commit 822285d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions httphelpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,10 +316,8 @@ func (r *httpRequest) makeRequest(ctx context.Context, method string, payload pa
resp, err := r.Client.Do(req)
if err != nil {
var urlErr *url.Error
if errors.As(err, &urlErr) {
if urlErr != nil && errors.Is(urlErr.Err, io.EOF) {
return nil, errors.Wrap(err, "remote server prematurely closed connection")
}
if errors.As(err, &urlErr) && urlErr != nil && errors.Is(urlErr.Err, io.EOF) {
return nil, errors.Wrap(err, "remote server prematurely closed connection")
}

return nil, errors.Wrap(err, "while making http request")
Expand Down

0 comments on commit 822285d

Please sign in to comment.