Skip to content

Commit

Permalink
Check for context error that is wrapped in url.Error
Browse files Browse the repository at this point in the history
Signed-off-by: Evgeniy Makhrov <e.makhrov@corp.badoo.com>
  • Loading branch information
Evgeniy Makhrov committed Aug 3, 2020
1 parent 3969120 commit 8ccb46a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions client/request.go
Expand Up @@ -134,8 +134,7 @@ func (cli *Client) doRequest(ctx context.Context, req *http.Request) (serverResp

// Don't decorate context sentinel errors; users may be comparing to
// them directly.
switch err {
case context.Canceled, context.DeadlineExceeded:
if errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded) {
return serverResp, err
}

Expand Down

0 comments on commit 8ccb46a

Please sign in to comment.