Exception: JSONAPI::Exceptions::RecordNotFound
- Defined in:
- lib/jsonapi/exceptions.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
Attributes inherited from Error
Instance Method Summary collapse
- #errors ⇒ Object
-
#initialize(id, error_object_overrides = {}) ⇒ RecordNotFound
constructor
A new instance of RecordNotFound.
Methods inherited from Error
Constructor Details
#initialize(id, error_object_overrides = {}) ⇒ RecordNotFound
Returns a new instance of RecordNotFound.
89 90 91 92 |
# File 'lib/jsonapi/exceptions.rb', line 89 def initialize(id, error_object_overrides = {}) @id = id super(error_object_overrides) end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
87 88 89 |
# File 'lib/jsonapi/exceptions.rb', line 87 def id @id end |
Instance Method Details
#errors ⇒ Object
94 95 96 97 98 99 100 101 |
# File 'lib/jsonapi/exceptions.rb', line 94 def errors [create_error_object(code: JSONAPI::RECORD_NOT_FOUND, status: :not_found, title: I18n.translate('jsonapi-resources.exceptions.record_not_found.title', default: 'Record not found'), detail: I18n.translate('jsonapi-resources.exceptions.record_not_found.detail', default: "The record identified by #{id} could not be found.", id: id))] end |