diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2020-07-12 22:18:01 +0200 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2020-07-31 21:07:19 +0900 |
commit | 3921ab8291925f2d177535d38d2aaaa020f5d546 (patch) | |
tree | be5d72847c4089f3f15b13f5352ed057bb36a74b /lib | |
parent | ebf008b9aea71fdf9be8dcc92faae1c024201bf9 (diff) |
[rubygems/rubygems] Let more exceptions flow
If any error happens while verifying a package entry, it doesn't mean
that the package is corrupt. It could be a bug in rubygems, for example.
This in fact happened in CI and the current error doesn't make it easy
to troubleshoot the root cause, since it doesn't provide a backtrace.
See
https://github.com/rubygems/rubygems/pull/3807/checks?check_run_id=862526615.
So I propose to let the exception happens. There was something useful
about the previous message, which is the file entry where the error
happened, so I'm keeping that information in a warning message.
https://github.com/rubygems/rubygems/commit/ece87d858f
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3379
Diffstat (limited to 'lib')
-rw-r--r-- | lib/rubygems/package.rb | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/rubygems/package.rb b/lib/rubygems/package.rb index 53ae696e97..9b53cd4a7b 100644 --- a/lib/rubygems/package.rb +++ b/lib/rubygems/package.rb @@ -669,10 +669,9 @@ EOM when 'data.tar.gz' then verify_gz entry end - rescue => e - message = "package is corrupt, exception while verifying: " + - "#{e.message} (#{e.class})" - raise Gem::Package::FormatError.new message, @gem + rescue + warn "Exception while verifying #{@gem.path}" + raise end ## |