diff options
author | Andre Arko <andre@arko.net> | 2015-12-26 18:07:37 +0800 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2016-01-25 10:49:44 -0600 |
commit | d0c9837ab8f2f86253ecdc48c3fce2667abc9b50 (patch) | |
tree | dc3e0f28d9aa5d31358cb47066755955ef9f2fd6 /lib/bundler/fetcher | |
parent | b1b8eb4ff8ca55ee526290c84417c62a889a932b (diff) | |
download | bundler-d0c9837ab8f2f86253ecdc48c3fce2667abc9b50.tar.gz |
slightly nicer HTTP exception messages
Diffstat (limited to 'lib/bundler/fetcher')
-rw-r--r-- | lib/bundler/fetcher/downloader.rb | 6 |
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 |