Exception: Fopost::ValidationError
- Defined in:
- lib/fopost/errors.rb
Overview
400 or 422 — the request body did not pass validation.
Instance Attribute Summary
Attributes inherited from Error
#body, #code, #message, #status
Instance Method Summary collapse
-
#errors ⇒ Object
Per-field messages, when the API sends them.
Methods inherited from Error
Constructor Details
This class inherits a constructor from Fopost::Error
Instance Method Details
#errors ⇒ Object
Per-field messages, when the API sends them.
35 36 37 38 |
# File 'lib/fopost/errors.rb', line 35 def errors value = body.is_a?(Hash) ? (body['errors'] || body[:errors]) : nil value.is_a?(Hash) || value.is_a?(Array) ? value : nil end |