Exception: BaseCradle::ValidationError
- Defined in:
- lib/basecradle/errors.rb
Overview
A submitted record failed validation (HTTP 422). errors maps attribute name to a list of messages (empty when the API sent none).
Direct Known Subclasses
CurrentPasswordIncorrectError, PasswordConfirmationMismatchError
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
Attributes inherited from Error
#code, #detail, #instance, #problem, #status, #title
Instance Method Summary collapse
-
#initialize(message = nil, errors: nil, **kwargs) ⇒ ValidationError
constructor
A new instance of ValidationError.
Methods inherited from Error
Constructor Details
#initialize(message = nil, errors: nil, **kwargs) ⇒ ValidationError
Returns a new instance of ValidationError.
80 81 82 83 |
# File 'lib/basecradle/errors.rb', line 80 def initialize( = nil, errors: nil, **kwargs) super(, **kwargs) @errors = errors || {} end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
78 79 80 |
# File 'lib/basecradle/errors.rb', line 78 def errors @errors end |