Exception: DataMapperRest::ResourceInvalid

Inherits:
ClientError show all
Defined in:
lib/dm-rest-adapter/exceptions.rb

Overview

422 Unprocessable Entity

Instance Attribute Summary collapse

Attributes inherited from ConnectionError

#response

Instance Method Summary collapse

Methods inherited from ConnectionError

#to_s

Constructor Details

#initialize(response, message = nil) ⇒ ResourceInvalid

Returns a new instance of ResourceInvalid.



51
52
53
54
# File 'lib/dm-rest-adapter/exceptions.rb', line 51

def initialize(response, message = nil)
  super(response, message)
  @body = response.body unless response.body.nil?
end

Instance Attribute Details

#bodyObject (readonly)

On this case, we could try to retrieve the validation_errors from message body:



50
51
52
# File 'lib/dm-rest-adapter/exceptions.rb', line 50

def body
  @body
end