Exception: Bayarcash::ValidationError

Inherits:
Error
  • Object
show all
Defined in:
lib/bayarcash/errors.rb

Overview

Raised on HTTP 422 responses. Carries the validation error payload from the API.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#errorsHash, Array (readonly)

Returns the raw errors payload returned by the API.

Returns:

  • (Hash, Array)

    the raw errors payload returned by the API



10
11
12
# File 'lib/bayarcash/errors.rb', line 10

def errors
  @errors
end