Skip to content
This repository was archived by the owner on Oct 13, 2023. It is now read-only.

Commit 5a861b6

Browse files
Evgeniy MakhrovthaJeztah
authored andcommitted
Check for context error that is wrapped in url.Error
Signed-off-by: Evgeniy Makhrov <e.makhrov@corp.badoo.com> (cherry picked from commit 8ccb46a521964ab80490318504d6e02ae766a912) Signed-off-by: Sebastiaan van Stijn <github@gone.nl> Upstream-commit: 89da709cb784b900145099cc638bbe8e26268ecc Component: engine
1 parent 9b85cae commit 5a861b6

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

components/engine/client/request.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,7 @@ func (cli *Client) doRequest(ctx context.Context, req *http.Request) (serverResp
143143

144144
// Don't decorate context sentinel errors; users may be comparing to
145145
// them directly.
146-
switch err {
147-
case context.Canceled, context.DeadlineExceeded:
146+
if errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded) {
148147
return serverResp, err
149148
}
150149

0 commit comments

Comments
 (0)