Skip to content

Commit

Permalink
ensure err in client.roundTrip
Browse files Browse the repository at this point in the history
  • Loading branch information
imroc committed Jun 22, 2023
1 parent f6d7e2a commit 45ace4b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -1509,7 +1509,11 @@ func (c *Client) WrapRoundTrip(wrappers ...RoundTripWrapper) *Client {
func (c *Client) roundTrip(r *Request) (resp *Response, err error) {
resp = &Response{Request: r}
defer func() {
err = resp.Err
if err != nil {
resp.Err = err
} else {
err = resp.Err
}
}()

if r.Headers == nil {
Expand Down

0 comments on commit 45ace4b

Please sign in to comment.