Exception: HumanError::Errors::ResourceNotFoundError

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

Instance Attribute Summary

Attributes included from CrudError

#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 Method Details

#actionObject



26
27
28
# File 'lib/human_error/errors/crud_errors/resource_not_found_error.rb', line 26

def action
  @action || 'access'
end

#developer_detailsObject



18
19
20
# File 'lib/human_error/errors/crud_errors/resource_not_found_error.rb', line 18

def developer_details
  { "#{resource_name_underscored}_id" => resource_id }
end

#developer_messageObject



13
14
15
16
# File 'lib/human_error/errors/crud_errors/resource_not_found_error.rb', line 13

def developer_message
  "The #{resource_name} you attempted to #{action} for this request is either " \
  'not authorized for the authenticated user or does not exist.'
end

#friendly_messageObject



22
23
24
# File 'lib/human_error/errors/crud_errors/resource_not_found_error.rb', line 22

def friendly_message
  "Sorry! The #{resource_name} you tried to #{action} does not exist."
end

#http_statusObject



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

def http_status
  404
end