[rubygems/rubygems] Only delete cached gem when it's corrupted

Rescuing all errors here might end up hiding other errors if the
deletion of the cached gem itself raises an error for some reason. Let's
be more conservative.

https://github.com/rubygems/rubygems/commit/3d80dfba08
This commit is contained in:
David Rodríguez 2021-10-27 22:15:31 +02:00 коммит произвёл git
Родитель cbf2078a25
Коммит d8e97169ba
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -162,7 +162,7 @@ module Bundler
begin begin
s = Bundler.rubygems.spec_from_gem(path, Bundler.settings["trust-policy"]) s = Bundler.rubygems.spec_from_gem(path, Bundler.settings["trust-policy"])
spec.__swap__(s) spec.__swap__(s)
rescue StandardError rescue Gem::Package::FormatError
Bundler.rm_rf(path) Bundler.rm_rf(path)
raise raise
end end