Exception: Anypost::ValidationError
- Defined in:
- lib/anypost/errors.rb
Overview
400/422 — the request body or query failed validation.
Instance Attribute Summary collapse
-
#errors ⇒ Hash{String => Array<String>}
readonly
Field path -> list of problems.
Attributes inherited from Error
#raw, #request_id, #status, #type
Instance Method Summary collapse
-
#initialize(message, errors: {}, **kwargs) ⇒ ValidationError
constructor
A new instance of ValidationError.
Constructor Details
#initialize(message, errors: {}, **kwargs) ⇒ ValidationError
Returns a new instance of ValidationError.
34 35 36 37 |
# File 'lib/anypost/errors.rb', line 34 def initialize(, errors: {}, **kwargs) super(, **kwargs) @errors = errors || {} end |
Instance Attribute Details
#errors ⇒ Hash{String => Array<String>} (readonly)
Returns field path -> list of problems.
32 33 34 |
# File 'lib/anypost/errors.rb', line 32 def errors @errors end |