aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rubygems/exceptions.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rubygems/exceptions.rb')
-rw-r--r--lib/rubygems/exceptions.rb24
1 files changed, 22 insertions, 2 deletions
diff --git a/lib/rubygems/exceptions.rb b/lib/rubygems/exceptions.rb
index 6bd50eca2c..2a9875cd24 100644
--- a/lib/rubygems/exceptions.rb
+++ b/lib/rubygems/exceptions.rb
@@ -27,7 +27,7 @@ class Gem::DependencyRemovalException < Gem::Exception; end
# toplevel. Indicates which dependencies were incompatible through #conflict
# and #conflicting_dependencies
-class Gem::DependencyResolutionError < Gem::Exception
+class Gem::DependencyResolutionError < Gem::DependencyError
attr_reader :conflict
@@ -214,7 +214,7 @@ end
# Raised by Resolver when a dependency requests a gem for which
# there is no spec.
-class Gem::UnsatisfiableDependencyError < Gem::Exception
+class Gem::UnsatisfiableDependencyError < Gem::DependencyError
##
# The unsatisfiable dependency. This is a
@@ -223,6 +223,11 @@ class Gem::UnsatisfiableDependencyError < Gem::Exception
attr_reader :dependency
##
+ # Errors encountered which may have contributed to this exception
+
+ attr_accessor :errors
+
+ ##
# Creates a new UnsatisfiableDependencyError for the unsatisfiable
# Gem::Resolver::DependencyRequest +dep+
@@ -239,6 +244,21 @@ class Gem::UnsatisfiableDependencyError < Gem::Exception
end
@dependency = dep
+ @errors = []
+ end
+
+ ##
+ # The name of the unresolved dependency
+
+ def name
+ @dependency.name
+ end
+
+ ##
+ # The Requirement of the unresolved dependency (not Version).
+
+ def version
+ @dependency.requirement
end
end