mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 15:37:56 -05:00
Check nil before logging "Failed to close response body..." (#11011)
This commit is contained in:
@@ -165,7 +165,9 @@ func (c *Client) do(ctx context.Context, method string, path string, body io.Rea
|
||||
}
|
||||
defer func() {
|
||||
closeErr := r.Body.Close()
|
||||
log.WithError(closeErr).Error("Failed to close response body")
|
||||
if closeErr != nil {
|
||||
log.WithError(closeErr).Error("Failed to close response body")
|
||||
}
|
||||
}()
|
||||
if r.StatusCode != http.StatusOK {
|
||||
err = non200Err(r)
|
||||
|
||||
Reference in New Issue
Block a user