summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Giddins <segiddins@segiddins.me>2016-01-04 21:43:14 -0600
committerSamuel Giddins <segiddins@segiddins.me>2016-01-25 10:49:51 -0600
commit18a27b3ad92ee4b7d96bc3c27028b6752d682ec5 (patch)
tree0bf84fae5ea6bb75c6a4d886a937dd193a25ec1c
parent48de6e8857bed06dd69f0be4122943d6aa6830d6 (diff)
downloadbundler-18a27b3ad92ee4b7d96bc3c27028b6752d682ec5.tar.gz
[CompactIndexClient] Don't raise Bundler::HTTPError
-rw-r--r--lib/bundler/fetcher/compact_index.rb4
-rw-r--r--lib/bundler/vendor/compact_index_client/lib/compact_index_client.rb2
-rw-r--r--lib/bundler/vendor/compact_index_client/lib/compact_index_client/updater.rb4
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