require 'human_error/errors/crud_error'
require 'human_error/errors/request_error'

class   HumanError
module  Errors
class   ResourceNotFoundError < RequestError
  include CrudError

  def http_status
    404
  end

  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

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

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

require 'human_error/errors/crud_error'
require 'human_error/errors/request_error'

class   HumanError
module  Errors
class   ResourceNotFoundError < RequestError
  include CrudError

  def http_status
    404
  end

  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

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

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

  def action
    @action || 'access'
  end
end
end
end

Allow ResourceNotFoundError to have a default action
Feature: Allow ResourceNotFoundError to have a default action

--------------------------------------------------------------------------------
Change-Id:     I51b10d48d5f767a51d58a5d401ecf8ccc8a94a46
Signed-off-by: Jeff Felchner <8a84c204e2d4c387d61d20f7892a2bbbf0bc8ae8@thekompanee.com>
