Exception: Brut::Framework::Errors::NotFound
- Inherits:
-
Brut::Framework::Error
- Object
- StandardError
- Brut::Framework::Error
- Brut::Framework::Errors::NotFound
- Defined in:
- lib/brut/framework/errors/not_found.rb
Overview
Indicates that a resource or database row does not exist.
Instance Method Summary collapse
-
#initialize(resource_name:, id: nil, search_terms: nil, context: nil) ⇒ NotFound
constructor
id is present.
Constructor Details
#initialize(resource_name:, id: nil, search_terms: nil, context: nil) ⇒ NotFound
id is present.
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/brut/framework/errors/not_found.rb', line 8 def initialize(resource_name:,id: nil, search_terms: nil,context:nil) if !context.nil? context = ": #{context}" end fragment = if id.nil? "Search '#{search_terms.inspect}'" else "ID '#{id}'" end super("Could not find a #{resource_name} using #{fragment}#{context}") end |