summaryrefslogtreecommitdiff
path: root/lib/rubygems/util.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rubygems/util.rb')
-rw-r--r--lib/rubygems/util.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/rubygems/util.rb b/lib/rubygems/util.rb
index 196cbe0645..dcd7fc2b47 100644
--- a/lib/rubygems/util.rb
+++ b/lib/rubygems/util.rb
@@ -11,7 +11,13 @@ module Gem::Util
require 'stringio'
data = StringIO.new(data, 'r')
- unzipped = Zlib::GzipReader.new(data).read
+ gzip_reader = begin
+ Zlib::GzipReader.new(data)
+ rescue Zlib::GzipFile::Error => e
+ raise e.class, e.inspect, e.backtrace
+ end
+
+ unzipped = gzip_reader.read
unzipped.force_encoding Encoding::BINARY
unzipped
end