Exception: Caprese::RecordNotFoundError
- Defined in:
- lib/caprese/errors.rb
Overview
Thrown when a record could not be found
Instance Attribute Summary
Attributes inherited from Error
Instance Method Summary collapse
- #full_message ⇒ Object
-
#initialize(model: nil, value: nil) ⇒ RecordNotFoundError
constructor
A new instance of RecordNotFoundError.
Methods inherited from Error
#as_json, #i18n_scope, #t, #with_header
Constructor Details
#initialize(model: nil, value: nil) ⇒ RecordNotFoundError
Returns a new instance of RecordNotFoundError.
28 29 30 31 |
# File 'lib/caprese/errors.rb', line 28 def initialize(model: nil, value: nil) super field: :id, code: :not_found, t: { model: model, value: value } @header = { status: :not_found } end |
Instance Method Details
#full_message ⇒ Object
33 34 35 |
# File 'lib/caprese/errors.rb', line 33 def I18n.t("#{i18n_scope}.parameters.not_found", t) end |