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.



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

def initialize(errors)
  @errors = errors
end

Instance Method Details

#to_sObject Also known as: message



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

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