Exception: FunWithJsonApi::Exceptions::InvalidDocumentIdentifier

Inherits:
FunWithJsonApi::Exception show all
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

#payload

Instance Method Summary collapse

Methods inherited from FunWithJsonApi::Exception

#http_status

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(message, 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