lib/solve/errors.rb in solve-0.6.1 vs lib/solve/errors.rb in solve-0.7.0
- old
+ new
@@ -29,7 +29,21 @@
"'#{constraint}' did not contain a valid operator or a valid version string."
end
end
class NoSolutionError < SolveError; end
+
+ class UnsortableSolutionError < SolveError
+ attr_reader :internal_exception
+ attr_reader :unsorted_solution
+
+ def initialize(internal_exception, unsorted_solution)
+ @internal_exception = internal_exception
+ @unsorted_solution = unsorted_solution
+ end
+
+ def to_s
+ "The solution contains a cycle and cannot be topologically sorted. See #unsorted_solution on this exception for the unsorted solution"
+ end
+ end
end
end