lib/bundler/fetcher.rb
# This error is raised if the API returns a 413 (only printed in verbose)
This error is raised if the API returns a 413 (only printed in verbose)
This error is raised if the API returns a 413 ( only printed in verbose )
def fetch(uri, counter = 0)
      raise HTTPError, "Too many redirects" if counter >= @redirect_limit
      begin
        Bundler.ui.debug "Fetching from: #{uri}"
        req = Net::HTTP::Get.new uri.request_uri
        req.basic_auth(uri.user, uri.password) if uri.user
        response = connection.request(uri, req)
      rescue OpenSSL::SSL::SSLError
        raise CertificateFailureError.new(uri)
      rescue *HTTP_ERRORS
        raise HTTPError, "Network error while fetching #{uri}"
      end
      case response
      when Net::HTTPRedirection
        Bundler.ui.debug("HTTP Redirection")
        new_uri = URI.parse(response["location"])
        if new_uri.host == uri.host
          new_uri.user = uri.user
          new_uri.password = uri.password
        end
        fetch(new_uri, counter + 1)
      when Net::HTTPSuccess
        Bundler.ui.debug("HTTP Success")
        response.body
      when Net::HTTPRequestEntityTooLarge
        raise FallbackError, response.body
      else
        raise HTTPError, "#{response.class}: #{response.body}"
      end
    end
def fetch ( uri , counter = 0 ) raise HTTPError , "Too many redirects" if counter >= @redirect_limit begin Bundler . ui . debug "Fetching from: #{uri}" req = Net :: HTTP :: Get . new uri . request_uri req . basic_auth ( uri . user , uri . password ) if uri . user response = connection . request ( uri , req ) rescue OpenSSL :: SSL :: SSLError raise CertificateFailureError . new ( uri ) rescue * HTTP_ERRORS raise HTTPError , "Network error while fetching #{uri}" end case response when Net :: HTTPRedirection Bundler . ui . debug ( "HTTP Redirection" ) new_uri = URI . parse ( response [ "location" ] ) if new_uri . host == uri . host new_uri . user = uri . user new_uri . password = uri . password end fetch ( new_uri , counter + 1 ) when Net :: HTTPSuccess Bundler . ui . debug ( "HTTP Success" ) response . body when Net :: HTTPRequestEntityTooLarge raise FallbackError , response . body else raise HTTPError , "#{response.class}: #{response.body}" end end
This error is raised if the API returns a 413 (only printed in verbose)
This error is raised if the API returns a 413 ( only printed in verbose )
uri
<not_specific>
counter
<not_specific>