summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
-rw-r--r--lib/bundler/fetcher.rb36
1 files changed, 25 insertions, 11 deletions
@@ -81,17 +81,31 @@ module Bundler
# Exceptions classes that should bypass retry attempts. If your password didn't work the
# first time, it's not going to the third time.
- NET_ERRORS = [:HTTPBadGateway, :HTTPBadRequest, :HTTPFailedDependency,
- :HTTPForbidden, :HTTPInsufficientStorage, :HTTPMethodNotAllowed,
- :HTTPMovedPermanently, :HTTPNoContent, :HTTPNotFound,
- :HTTPNotImplemented, :HTTPPreconditionFailed, :HTTPRequestEntityTooLarge,
- :HTTPRequestURITooLong, :HTTPUnauthorized, :HTTPUnprocessableEntity,
- :HTTPUnsupportedMediaType, :HTTPVersionNotSupported].freeze
- FAIL_ERRORS = begin
- fail_errors = [AuthenticationRequiredError, BadAuthenticationError, AuthenticationForbiddenError, FallbackError, SecurityError]
- fail_errors << Gem::Requirement::BadRequirementError
- fail_errors.concat(NET_ERRORS.map {|e| Gem::Net.const_get(e) })
- end.freeze
class << self
attr_accessor :disable_endpoint, :api_timeout, :redirect_limit, :max_retries