lib/rasn1/errors.rb in rasn1-0.11.0 vs lib/rasn1/errors.rb in rasn1-0.12.0
- old
+ new
@@ -18,12 +18,18 @@
# Enumerated error
class EnumeratedError < Error; end
# CHOICE error: #chosen not set
class ChoiceError < RASN1::Error
+ # @param [Types::Base] object
+ def initialize(object)
+ @object = object
+ super()
+ end
+
def message
- "CHOICE #{@name}: #chosen not set"
+ "CHOICE #{@object.name}: #chosen not set"
end
end
# Exception raised when a constraint is not verified on a constrained type.
# @version 0.11.0
@@ -35,9 +41,14 @@
super()
end
# @return [String]
def message
- "Constraint not verified on #{object.inspect}"
+ "Constraint not verified on #{@object.inspect}"
end
+ end
+
+ # Exception raised when model validation fails
+ # @since 0.12.0
+ class ModelValidationError < Error
end
end