Class: Hanami::Settings::InvalidSettingsError
- Defined in:
- lib/hanami/settings.rb
Overview
Error raised when setting values do not meet their type expectations.
Its message collects all the individual errors that can be raised for each setting.
Instance Method Summary collapse
-
#initialize(errors) ⇒ InvalidSettingsError
constructor
private
A new instance of InvalidSettingsError.
-
#to_s ⇒ String
Returns the exception’s message.
Constructor Details
#initialize(errors) ⇒ InvalidSettingsError
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of InvalidSettingsError.
67 68 69 70 |
# File 'lib/hanami/settings.rb', line 67 def initialize(errors) super() @errors = errors end |
Instance Method Details
#to_s ⇒ String
Returns the exception’s message.
78 79 80 81 82 83 84 |
# File 'lib/hanami/settings.rb', line 78 def to_s <<~STR.strip Could not initialize settings. The following settings were invalid: #{@errors.map { |setting, | "#{setting}: #{}" }.join("\n")} STR end |