Exception: Bayarcash::ValidationError
- Defined in:
- lib/bayarcash/errors.rb
Overview
Raised on HTTP 422 responses. Carries the validation error payload from the API.
Instance Attribute Summary collapse
-
#errors ⇒ Hash, Array
readonly
The raw errors payload returned by the API.
Instance Method Summary collapse
-
#initialize(errors = {}) ⇒ ValidationError
constructor
A new instance of ValidationError.
Constructor Details
#initialize(errors = {}) ⇒ ValidationError
Returns a new instance of ValidationError.
12 13 14 15 |
# File 'lib/bayarcash/errors.rb', line 12 def initialize(errors = {}) @errors = errors || {} super("The given data failed to pass validation.") end |
Instance Attribute Details
#errors ⇒ Hash, Array (readonly)
Returns the raw errors payload returned by the API.
10 11 12 |
# File 'lib/bayarcash/errors.rb', line 10 def errors @errors end |