summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrey Baker <greysteil@gmail.com>2019-01-03 15:23:17 +0000
committerGrey Baker <greysteil@gmail.com>2019-01-03 15:23:17 +0000
commit95f9094c96d6923f9a7995b97ddb92b9c5c4bb96 (patch)
treeb7b34f093bf91c90573b4f2e13c0af9f3ca275ef
parenta63a39d738865665f714f179fe42dd10006da26d (diff)
downloadbundler-95f9094c96d6923f9a7995b97ddb92b9c5c4bb96.tar.gz
Include URL in Bundler::Fetcher::FallbackError message for Net::HTTPNotFound
-rw-r--r--lib/bundler/fetcher/downloader.rb2
-rw-r--r--spec/bundler/fetcher/downloader_spec.rb3
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/bundler/fetcher/downloader.rb b/lib/bundler/fetcher/downloader.rb
index e0e0cbf1c9..a75a36055d 100644
--- a/lib/bundler/fetcher/downloader.rb
+++ b/lib/bundler/fetcher/downloader.rb
@@ -37,7 +37,7 @@ module Bundler
when Net::HTTPUnauthorized
raise AuthenticationRequiredError, uri.host
when Net::HTTPNotFound
- raise FallbackError, "Net::HTTPNotFound"
+ raise FallbackError, "Net::HTTPNotFound: #{uri}"
else
raise HTTPError, "#{response.class}#{": #{response.body}" unless response.body.empty?}"
end
diff --git a/spec/bundler/fetcher/downloader_spec.rb b/spec/bundler/fetcher/downloader_spec.rb
index c9b4fa662a..ac2c197956 100644
--- a/spec/bundler/fetcher/downloader_spec.rb
+++ b/spec/bundler/fetcher/downloader_spec.rb
@@ -88,7 +88,8 @@ RSpec.describe Bundler::Fetcher::Downloader do
let(:http_response) { Net::HTTPNotFound.new("1.1", 404, "Not Found") }
it "should raise a Bundler::Fetcher::FallbackError with Net::HTTPNotFound" do
- expect { subject.fetch(uri, options, counter) }.to raise_error(Bundler::Fetcher::FallbackError, "Net::HTTPNotFound")
+ expect { subject.fetch(uri, options, counter) }.
+ to raise_error(Bundler::Fetcher::FallbackError, "Net::HTTPNotFound: http://www.uri-to-fetch.com/api/v2/endpoint")
end
end