Exception: Amply::Exceptions::ValidationException

Inherits:
StandardError
  • Object
show all
Defined in:
lib/amply/exceptions/validation_exception.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ ValidationException

Returns a new instance of ValidationException.



8
9
10
11
12
# File 'lib/amply/exceptions/validation_exception.rb', line 8

def initialize(response)
  @errors = JSON.parse(response.body, symbolize_names: true)[:errors]

  super
end

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors.



6
7
8
# File 'lib/amply/exceptions/validation_exception.rb', line 6

def errors
  @errors
end

Instance Method Details

#messageObject



14
15
16
# File 'lib/amply/exceptions/validation_exception.rb', line 14

def message
  'A validation error occurred while making an API request'
end