Exception: BaseCradle::ValidationError

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

Overview

A submitted record failed validation (HTTP 422). errors maps attribute name to a list of messages (empty when the API sent none).

Instance Attribute Summary collapse

Attributes inherited from Error

#code, #detail, #instance, #problem, #status, #title

Instance Method Summary collapse

Methods inherited from Error

from_response

Constructor Details

#initialize(message = nil, errors: nil, **kwargs) ⇒ ValidationError

Returns a new instance of ValidationError.



80
81
82
83
# File 'lib/basecradle/errors.rb', line 80

def initialize(message = nil, errors: nil, **kwargs)
  super(message, **kwargs)
  @errors = errors || {}
end

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors.



78
79
80
# File 'lib/basecradle/errors.rb', line 78

def errors
  @errors
end