Exception: Berkshelf::InvalidConfiguration

Inherits:
BerkshelfError show all
Defined in:
lib/berkshelf/errors.rb

Instance Method Summary collapse

Methods inherited from BerkshelfError

set_status_code

Constructor Details

#initialize(errors) ⇒ InvalidConfiguration

Returns a new instance of InvalidConfiguration.



157
158
159
# File 'lib/berkshelf/errors.rb', line 157

def initialize(errors)
  @errors = errors
end

Instance Method Details

#to_sObject Also known as: message



161
162
163
164
165
166
167
168
169
170
# File 'lib/berkshelf/errors.rb', line 161

def to_s
  out = "Invalid configuration:\n"
  @errors.each do |key, errors|
    errors.each do |error|
      out << "  #{key} #{error}\n"
    end
  end

  out.strip
end