Exception: FunWithJsonApi::Exceptions::InvalidDocumentIdentifier
- Inherits:
-
FunWithJsonApi::Exception
- Object
- StandardError
- FunWithJsonApi::Exception
- FunWithJsonApi::Exceptions::InvalidDocumentIdentifier
- Defined in:
- lib/fun_with_json_api/exceptions/invalid_document_identifier.rb
Overview
A server MUST return 409 Conflict when processing a PATCH request in which the resource object’s type and id do not match the server’s endpoint
Constant Summary collapse
- EXCEPTION_CODE =
'invalid_document_identifier'.freeze
Instance Attribute Summary
Attributes inherited from FunWithJsonApi::Exception
Instance Method Summary collapse
-
#initialize(message, payload = ExceptionPayload.new) ⇒ InvalidDocumentIdentifier
constructor
A new instance of InvalidDocumentIdentifier.
Methods inherited from FunWithJsonApi::Exception
Constructor Details
#initialize(message, payload = ExceptionPayload.new) ⇒ InvalidDocumentIdentifier
Returns a new instance of InvalidDocumentIdentifier.
8 9 10 11 12 13 14 |
# File 'lib/fun_with_json_api/exceptions/invalid_document_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 ||= '409' payload.pointer ||= '/data/id' super end |