Fix for invalid_download_code
This commit is contained in:
@@ -276,11 +276,14 @@ func (r *HTTPClient) shouldRetry(req *http.Request, resp *http.Response, err err
|
||||
return -1 // don't retry
|
||||
}
|
||||
} else if downloadErr, ok := err.(*DownloadErrorResponse); ok {
|
||||
switch downloadErr.Code {
|
||||
case http.StatusServiceUnavailable: // Service unavailable
|
||||
switch downloadErr.Message {
|
||||
case "bytes_limit_reached": // 503
|
||||
return -1
|
||||
default:
|
||||
case "invalid_download_code": // 404
|
||||
time.Sleep(time.Duration(rateLimitSleep) * time.Second)
|
||||
return 1
|
||||
default:
|
||||
return 1 // retry
|
||||
}
|
||||
}
|
||||
if err != nil && strings.Contains(err.Error(), "timeout") {
|
||||
|
||||
Reference in New Issue
Block a user