summaryrefslogtreecommitdiff
path: root/lib/bundler/fetcher
diff options
context:
space:
mode:
authorAndre Arko <andre@arko.net>2015-12-26 18:07:37 +0800
committerSamuel Giddins <segiddins@segiddins.me>2016-01-25 10:49:44 -0600
commitd0c9837ab8f2f86253ecdc48c3fce2667abc9b50 (patch)
treedc3e0f28d9aa5d31358cb47066755955ef9f2fd6 /lib/bundler/fetcher
parentb1b8eb4ff8ca55ee526290c84417c62a889a932b (diff)
downloadbundler-d0c9837ab8f2f86253ecdc48c3fce2667abc9b50.tar.gz
slightly nicer HTTP exception messages
Diffstat (limited to 'lib/bundler/fetcher')
-rw-r--r--lib/bundler/fetcher/downloader.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/bundler/fetcher/downloader.rb b/lib/bundler/fetcher/downloader.rb
index 284330a229..662bf43904 100644
--- a/lib/bundler/fetcher/downloader.rb
+++ b/lib/bundler/fetcher/downloader.rb
@@ -25,12 +25,14 @@ module Bundler
new_uri.password = uri.password
end
fetch(new_uri, options, counter + 1)
- when Net::HTTPRequestEntityTooLarge, Net::HTTPNotFound
+ when Net::HTTPRequestEntityTooLarge
raise FallbackError, response.body
when Net::HTTPUnauthorized
raise AuthenticationRequiredError, uri.host
+ when Net::HTTPNotFound
+ raise FallbackError, "Net::HTTPNotFound"
else
- raise HTTPError, "#{response.class}: #{response.body}"
+ raise HTTPError, "#{response.class}#{': ' + response.body if !response.body.empty?}"
end
end