mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Unwrap URL errors on retry
When authorization errors are returned by the token process the error will be wrapped in url.Error. In order to check the underlying error for retry this error message should be unwrapped. Unwrapping this error allows failure to push due to an unauthorized response to keep from retrying, possibly resulting in later 429 responses. Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
This commit is contained in:
parent
7bddbdf360
commit
e9d5292b0c
1 changed files with 2 additions and 0 deletions
|
@ -145,6 +145,8 @@ func retryOnError(err error) error {
|
||||||
case errcode.ErrorCodeUnauthorized, errcode.ErrorCodeUnsupported, errcode.ErrorCodeDenied:
|
case errcode.ErrorCodeUnauthorized, errcode.ErrorCodeUnsupported, errcode.ErrorCodeDenied:
|
||||||
return xfer.DoNotRetry{Err: err}
|
return xfer.DoNotRetry{Err: err}
|
||||||
}
|
}
|
||||||
|
case *url.Error:
|
||||||
|
return retryOnError(v.Err)
|
||||||
case *client.UnexpectedHTTPResponseError:
|
case *client.UnexpectedHTTPResponseError:
|
||||||
return xfer.DoNotRetry{Err: err}
|
return xfer.DoNotRetry{Err: err}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue