diff --git a/transport/http/client.go b/transport/http/client.go index 55719eb9e..2ae29ffb2 100644 --- a/transport/http/client.go +++ b/transport/http/client.go @@ -289,13 +289,12 @@ func (client *Client) do(req *http.Request) (*http.Response, error) { if err == nil { err = client.opts.errorDecoder(req.Context(), resp) } - - if err != nil { - return nil, err - } if done != nil { done(req.Context(), selector.DoneInfo{Err: err}) } + if err != nil { + return nil, err + } return resp, nil }