1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #41292 from eelf/pass_network_error

Pass underlying network error in ErrorConnectionFailed
This commit is contained in:
Sebastiaan van Stijn 2020-08-04 17:43:14 +02:00 committed by GitHub
commit 3f9876e631
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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
}