Exception: FunWithJsonApi::Exceptions::IllegalClientGeneratedIdentifier
- Inherits:
-
FunWithJsonApi::Exception
- Object
- StandardError
- FunWithJsonApi::Exception
- FunWithJsonApi::Exceptions::IllegalClientGeneratedIdentifier
- Defined in:
- lib/fun_with_json_api/exceptions/illegal_client_generated_identifier.rb
Overview
A server MUST return 403 Forbidden in response to an unsupported request to create a resource with a client-generated ID.
Constant Summary collapse
- EXCEPTION_CODE =
'illegal_client_generated_identifier'.freeze
Instance Attribute Summary
Attributes inherited from FunWithJsonApi::Exception
Instance Method Summary collapse
-
#initialize(message, payload = ExceptionPayload.new) ⇒ IllegalClientGeneratedIdentifier
constructor
A new instance of IllegalClientGeneratedIdentifier.
Methods inherited from FunWithJsonApi::Exception
Constructor Details
#initialize(message, payload = ExceptionPayload.new) ⇒ IllegalClientGeneratedIdentifier
Returns a new instance of IllegalClientGeneratedIdentifier.
8 9 10 11 12 13 14 |
# File 'lib/fun_with_json_api/exceptions/illegal_client_generated_identifier.rb', line 8 def initialize(, payload = ExceptionPayload.new) payload.code ||= EXCEPTION_CODE payload.title ||= I18n.t(EXCEPTION_CODE, scope: 'fun_with_json_api.exceptions') payload.status ||= '403' payload.pointer ||= '/data/id' super end |