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, #with_header
Constructor Details
#initialize(model: nil, value: nil) ⇒ RecordNotFoundError
Returns a new instance of RecordNotFoundError.
43 44 45 46 |
# File 'lib/caprese/errors.rb', line 43 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
48 49 50 |
# File 'lib/caprese/errors.rb', line 48 def I18n.t("#{i18n_scope}.parameters.not_found", t) end |