Skip to content

Commit

Permalink
linter suggested fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ldemailly committed Apr 3, 2024
1 parent c417362 commit a77dadf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fhttp/http_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -1089,7 +1089,8 @@ func (c *FastClient) readResponse(conn net.Conn, reusedSocket bool) {
break
}
errMsg := "Read error"
if netErr, ok := err.(net.Error); ok && netErr.Timeout() {
var netErr net.Error
if errors.As(err, &netErr) && netErr.Timeout() {
errMsg = "Timeout error (incomplete/invalid response)"
}

Check warning on line 1095 in fhttp/http_client.go

View check run for this annotation

Codecov / codecov/patch

fhttp/http_client.go#L1094-L1095

Added lines #L1094 - L1095 were not covered by tests
log.S(log.Error, errMsg, log.Attr("err", err), log.Attr("size", c.size), log.Attr("header_len", c.headerLen),
Expand Down

0 comments on commit a77dadf

Please sign in to comment.