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