Skip to content

Commit

Permalink
Always show underlying error when fetching specs fails
Browse files Browse the repository at this point in the history
  • Loading branch information
deivid-rodriguez committed Nov 13, 2020
1 parent 22a6cbf commit dc00448
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions bundler/lib/bundler/fetcher/index.rb
Expand Up @@ -19,8 +19,7 @@ def specs(_gem_names)
raise BadAuthenticationError, remote_uri if remote_uri.userinfo
raise AuthenticationRequiredError, remote_uri
else
Bundler.ui.trace e
raise HTTPError, "Could not fetch specs from #{display_uri}"
raise HTTPError, "Could not fetch specs from #{display_uri} due to underlying error <#{e.message}>"
end
end

Expand Down
2 changes: 1 addition & 1 deletion bundler/spec/bundler/fetcher/index_spec.rb
Expand Up @@ -90,7 +90,7 @@
before { allow(Bundler).to receive(:ui).and_return(double(:trace => nil)) }

it "should raise a Bundler::HTTPError" do
expect { subject.specs(gem_names) }.to raise_error(Bundler::HTTPError, "Could not fetch specs from http://sample_uri.com")
expect { subject.specs(gem_names) }.to raise_error(Bundler::HTTPError, "Could not fetch specs from http://sample_uri.com due to underlying error <You get an error, you get an error! (http://sample_uri.com)>")
end
end
end
Expand Down

0 comments on commit dc00448

Please sign in to comment.