aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rubygems/package.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rubygems/package.rb')
-rw-r--r--lib/rubygems/package.rb18
1 files changed, 17 insertions, 1 deletions
diff --git a/lib/rubygems/package.rb b/lib/rubygems/package.rb
index 0fd27a0108..3a50ca118e 100644
--- a/lib/rubygems/package.rb
+++ b/lib/rubygems/package.rb
@@ -45,7 +45,23 @@ module Gem::Package
class ClosedIO < Error; end
class BadCheckSum < Error; end
class TooLongFileName < Error; end
- class FormatError < Error; end
+ class FormatError < Error
+ attr_reader :path
+
+ def initialize message, path = nil
+ @path = path
+
+ message << " in #{path}" if path
+
+ super message
+ end
+
+ end
+
+ ##
+ # Raised when a tar file is corrupt
+
+ class TarInvalidError < Error; end
def self.open(io, mode = "r", signer = nil, &block)
tar_type = case mode