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

Commit 340e0f5

Browse files
authored
Merge pull request #41312 from thaJeztah/19.03_backport_pass_network_error
[19.03 backport] Check for context error that is wrapped in url.Error Upstream-commit: 50b33bd3cd1789847ec62646738f98155f601141 Component: engine
2 parents 71f2583 + 5a861b6 commit 340e0f5

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)