summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDavid Rodríguez <[email protected]>2025-06-17 20:37:48 +0200
committerHiroshi SHIBATA <[email protected]>2025-06-23 11:07:00 +0900
commitc3bfce512baf6d0427216ea2ae24b7f191dfebee ()
tree0d82e74950a35d236ca2534d8d85593a16ec4981 /lib
parent627ca420e9f6ab1b3c4c424b9159abb595ffb55c (diff)
[rubygems/rubygems] Simplify non retriable errors list
https://.com/rubygems/rubygems/commit/627a7615f2
-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