class Hanami::Settings::InvalidSettingsError

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.

@api public @since 2.0.0

Public Class Methods

new(errors) click to toggle source

@api private

Calls superclass method
# File lib/hanami/settings.rb, line 67
def initialize(errors)
  super()
  @errors = errors
end

Public Instance Methods

to_s() click to toggle source

Returns the exception’s message.

@return [String]

@api public @since 2.0.0

# File lib/hanami/settings.rb, line 78
      def to_s
        <<~STR.strip
          Could not initialize settings. The following settings were invalid:

          #{@errors.map { |setting, message| "#{setting}: #{message}" }.join("\n")}
        STR
      end