diff options
author | Samuel Giddins <segiddins@segiddins.me> | 2016-01-04 21:43:14 -0600 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2016-01-25 10:49:51 -0600 |
commit | 18a27b3ad92ee4b7d96bc3c27028b6752d682ec5 (patch) | |
tree | 0bf84fae5ea6bb75c6a4d886a937dd193a25ec1c | |
parent | 48de6e8857bed06dd69f0be4122943d6aa6830d6 (diff) | |
download | bundler-18a27b3ad92ee4b7d96bc3c27028b6752d682ec5.tar.gz |
[CompactIndexClient] Don't raise Bundler::HTTPError
3 files changed, 7 insertions, 3 deletions
diff --git a/lib/bundler/fetcher/compact_index.rb b/lib/bundler/fetcher/compact_index.rb index 7381846b66..78178f601b 100644 --- a/lib/bundler/fetcher/compact_index.rb +++ b/lib/bundler/fetcher/compact_index.rb @@ -8,7 +8,7 @@ module Bundler def specs(gem_names) specs_for_names(gem_names) - rescue NetworkDownError => e + rescue NetworkDownError, CompactIndexClient::Updater::MisMatchedChecksumError => e raise HTTPError, e.message rescue AuthenticationRequiredError raise # We got a 401 from the server. Just fail. @@ -47,7 +47,7 @@ module Bundler def available? # Read info file checksums out of /versions, so we can know if gems are up to date fetch_uri.scheme != "file" && compact_index_client.update_and_parse_checksums! - rescue NetworkDownError => e + rescue NetworkDownError, CompactIndexClient::Updater::MisMatchedChecksumError => e raise HTTPError, e.message rescue AuthenticationRequiredError # We got a 401 from the server. Just fail. diff --git a/lib/bundler/vendor/compact_index_client/lib/compact_index_client.rb b/lib/bundler/vendor/compact_index_client/lib/compact_index_client.rb index a919f1e9e5..3fe5fc6004 100644 --- a/lib/bundler/vendor/compact_index_client/lib/compact_index_client.rb +++ b/lib/bundler/vendor/compact_index_client/lib/compact_index_client.rb @@ -2,6 +2,8 @@ require "pathname" require "set" class Bundler::CompactIndexClient + class Error < StandardError; end + require "bundler/vendor/compact_index_client/lib/compact_index_client/cache" require "bundler/vendor/compact_index_client/lib/compact_index_client/updater" require "bundler/vendor/compact_index_client/lib/compact_index_client/version" diff --git a/lib/bundler/vendor/compact_index_client/lib/compact_index_client/updater.rb b/lib/bundler/vendor/compact_index_client/lib/compact_index_client/updater.rb index 6c93db005a..7444bee45c 100644 --- a/lib/bundler/vendor/compact_index_client/lib/compact_index_client/updater.rb +++ b/lib/bundler/vendor/compact_index_client/lib/compact_index_client/updater.rb @@ -3,6 +3,8 @@ require "zlib" class Bundler::CompactIndexClient class Updater + class MisMatchedChecksumError < Error; end + def initialize(fetcher) @fetcher = fetcher end @@ -36,7 +38,7 @@ class Bundler::CompactIndexClient local_path.delete update(local_path, remote_path, :retrying) else - raise Bundler::HTTPError, "Checksum of /#{remote_path} " \ + raise MisMatchedChecksumError, "Checksum of /#{remote_path} " \ "does not match the checksum provided by server! Something is wrong." end end |