4 # Base exception class for RubyGems. All exception raised by RubyGems are a
5 # subclass of this one.
6 class Gem::Exception < RuntimeError; end
8 class Gem::CommandLineError < Gem::Exception; end
10 class Gem::DependencyError < Gem::Exception; end
12 class Gem::DependencyRemovalException < Gem::Exception; end
15 # Raised when attempting to uninstall a gem that isn't in GEM_HOME.
17 class Gem::GemNotInHomeException < Gem::Exception
21 class Gem::DocumentError < Gem::Exception; end
24 # Potentially raised when a specification is validated.
25 class Gem::EndOfYAMLException < Gem::Exception; end
28 # Signals that a file permission error is preventing the user from
29 # installing in the requested directories.
30 class Gem::FilePermissionError < Gem::Exception
32 super("You don't have write permissions into the #{path} directory.")
37 # Used to raise parsing and loading errors
38 class Gem::FormatException < Gem::Exception
39 attr_accessor :file_path
42 class Gem::GemNotFoundException < Gem::Exception; end
44 class Gem::InstallError < Gem::Exception; end
47 # Potentially raised when a specification is validated.
48 class Gem::InvalidSpecificationException < Gem::Exception; end
50 class Gem::OperationNotSupportedError < Gem::Exception; end
53 # Signals that a remote operation cannot be conducted, probably due to not
54 # being connected (or just not finding host).
56 # TODO: create a method that tests connection to the preferred gems server.
57 # All code dealing with remote operations will want this. Failure in that
58 # method should raise this error.
59 class Gem::RemoteError < Gem::Exception; end
61 class Gem::RemoteInstallationCancelled < Gem::Exception; end
63 class Gem::RemoteInstallationSkipped < Gem::Exception; end
66 # Represents an error communicating via HTTP.
67 class Gem::RemoteSourceException < Gem::Exception; end
69 class Gem::VerificationError < Gem::Exception; end
72 # Raised to indicate that a system exit should occur with the specified
75 class Gem::SystemExitException < SystemExit
76 attr_accessor :exit_code
78 def initialize(exit_code)
79 @exit_code = exit_code
81 super "Exiting RubyGems with exit_code #{exit_code}"