Exception: JSONAPI::Exceptions::CountMismatch

Inherits:
Error
  • Object
show all
Defined in:
lib/jsonapi/exceptions.rb

Instance Method Summary collapse

Instance Method Details

#errorsObject


324
325
326
327
328
329
330
331
# File 'lib/jsonapi/exceptions.rb', line 324

def errors
  [JSONAPI::Error.new(code: JSONAPI::COUNT_MISMATCH,
                      status: :bad_request,
                      title: I18n.translate('jsonapi-resources.exceptions.count_mismatch.title',
                                            default: 'Count to key mismatch'),
                      detail: I18n.translate('jsonapi-resources.exceptions.count_mismatch.detail',
                                             default: 'The resource collection does not contain the same number of objects as the number of keys.'))]
end