Exception: Crm::Errors::InvalidKeys
- Inherits:
-
ClientError
- Object
- StandardError
- BaseError
- ClientError
- Crm::Errors::InvalidKeys
- Defined in:
- lib/crm/errors.rb
Overview
InvalidKeys
is raised if a create or update request contains unknown attributes.
Instance Attribute Summary collapse
-
#validation_errors ⇒ Array<Hash{String => String}>
readonly
Returns the list of validation errors.
Instance Method Summary collapse
-
#initialize(message = nil, validation_errors = {}) ⇒ InvalidKeys
constructor
A new instance of InvalidKeys.
Constructor Details
#initialize(message = nil, validation_errors = {}) ⇒ InvalidKeys
Returns a new instance of InvalidKeys.
111 112 113 114 115 |
# File 'lib/crm/errors.rb', line 111 def initialize( = nil, validation_errors = {}) super("#{} #{validation_errors.map{ |h| h['message'] }.to_sentence}.") @validation_errors = validation_errors end |
Instance Attribute Details
#validation_errors ⇒ Array<Hash{String => String}> (readonly)
Returns the list of validation errors. The items in the list are hashes consisting of a code
(always unknown
), the invalid attribute
name and an English translation (message
).
109 110 111 |
# File 'lib/crm/errors.rb', line 109 def validation_errors @validation_errors end |