Exception: FunWithJsonApi::Exceptions::MissingResource
- Inherits:
-
FunWithJsonApi::Exception
- Object
- StandardError
- FunWithJsonApi::Exception
- FunWithJsonApi::Exceptions::MissingResource
- Defined in:
- lib/fun_with_json_api/exceptions/missing_resource.rb
Overview
Indicates a Resource or Collection item was not able to be found
Instance Attribute Summary
Attributes inherited from FunWithJsonApi::Exception
Instance Method Summary collapse
-
#initialize(message, payload = ExceptionPayload.new) ⇒ MissingResource
constructor
A new instance of MissingResource.
Methods inherited from FunWithJsonApi::Exception
Constructor Details
#initialize(message, payload = ExceptionPayload.new) ⇒ MissingResource
Returns a new instance of MissingResource.
5 6 7 8 9 10 11 12 |
# File 'lib/fun_with_json_api/exceptions/missing_resource.rb', line 5 def initialize(, payload = ExceptionPayload.new) payload = Array.wrap(payload).each do |missing| missing.code ||= 'missing_resource' missing.title ||= I18n.t('missing_resource', scope: 'fun_with_json_api.exceptions') missing.status ||= '404' end super end |