fix client do method done not use when err not nil (#1948)

status-code-override
李洛克 3 years ago committed by chenzhihui
parent 045c5001c9
commit 11273fc9a6
  1. 7
      transport/http/client.go

@ -289,13 +289,12 @@ func (client *Client) do(req *http.Request) (*http.Response, error) {
if err == nil { if err == nil {
err = client.opts.errorDecoder(req.Context(), resp) err = client.opts.errorDecoder(req.Context(), resp)
} }
if err != nil {
return nil, err
}
if done != nil { if done != nil {
done(req.Context(), selector.DoneInfo{Err: err}) done(req.Context(), selector.DoneInfo{Err: err})
} }
if err != nil {
return nil, err
}
return resp, nil return resp, nil
} }

Loading…
Cancel
Save