Retry uploads that get a 403 due to token expiry

This commit is contained in:
rubyist 2015-09-03 13:02:18 -04:00
parent 375c056ec5
commit a45802ce62

@ -314,6 +314,12 @@ func UploadObject(o *objectResource, cb CopyCallback) error {
}
LogTransfer("lfs.data.upload", res)
// A status code of 403 likely means that an authentication token for the
// upload has expired. This can be safely retried.
if res.StatusCode == 403 {
return newRetriableError(err)
}
if res.StatusCode > 299 {
return Errorf(nil, "Invalid status for %s %s: %d", req.Method, req.URL, res.StatusCode)
}