Exception: HumanError::Errors::ResourcePersistenceError

Inherits:
RequestError
  • Object
show all
Includes:
CrudError
Defined in:
lib/human_error/errors/crud_errors/resource_persistence_error.rb

Instance Attribute Summary collapse

Attributes included from CrudError

#action, #resource_id, #resource_name

Attributes included from HumanError::Error

#api_error_documentation_url, #api_version, #code, #knowledgebase_article_id, #knowledgebase_url, #message

Instance Method Summary collapse

Methods included from CrudError

#initialize

Methods inherited from RequestError

#as_json

Methods included from HumanError::Error

#customer_support_uri, #developer_documentation_uri, included, #initialize, #to_json, #to_s

Instance Attribute Details

#attributesObject

Returns the value of attribute attributes.



9
10
11
# File 'lib/human_error/errors/crud_errors/resource_persistence_error.rb', line 9

def attributes
  @attributes
end

#errorsObject

Returns the value of attribute errors.



9
10
11
# File 'lib/human_error/errors/crud_errors/resource_persistence_error.rb', line 9

def errors
  @errors
end

Instance Method Details

#developer_detailsObject



21
22
23
24
25
26
# File 'lib/human_error/errors/crud_errors/resource_persistence_error.rb', line 21

def developer_details
  {
    'errors'     => errors,
    'attributes' => attributes,
  }
end

#developer_messageObject



16
17
18
19
# File 'lib/human_error/errors/crud_errors/resource_persistence_error.rb', line 16

def developer_message
  "One or more of the attributes on the #{resource_name} you attempted " \
  "to #{action} is invalid."
end

#friendly_messageObject



28
29
30
# File 'lib/human_error/errors/crud_errors/resource_persistence_error.rb', line 28

def friendly_message
  "Sorry! We had a problem when tried to #{action} that #{resource_name}."
end

#http_statusObject



12
13
14
# File 'lib/human_error/errors/crud_errors/resource_persistence_error.rb', line 12

def http_status
  422
end