Exception: Brut::Framework::Errors::MissingParameter
- Inherits:
-
Brut::Framework::Error
- Object
- StandardError
- Brut::Framework::Error
- Brut::Framework::Errors::MissingParameter
- Defined in:
- lib/brut/framework/errors/missing_parameter.rb
Overview
Raised when an expected parameter in e.g. a path or a method invocation is
not available. This allows classes to give a better error message than
the one provided by standard library exceptions like KeyError
Instance Method Summary collapse
-
#initialize(missing_param, params_received:, context:) ⇒ MissingParameter
constructor
Create the exception.
Constructor Details
#initialize(missing_param, params_received:, context:) ⇒ MissingParameter
Create the exception
9 10 11 |
# File 'lib/brut/framework/errors/missing_parameter.rb', line 9 def initialize(missing_param, params_received:, context:) super("Parameter '#{missing_param}' was not available. Received params: #{params_received.empty? ? 'no params' : "'" + params_received.join(', ') + "'"}. #{context}") end |