Method: ChefApply::UI::ErrorPrinter.error_summary

Defined in:
lib/chef_apply/ui/error_printer.rb

.error_summary(e) ⇒ Object



181
182
183
184
185
186
187
188
189
190
191
192
193
194
# File 'lib/chef_apply/ui/error_printer.rb', line 181

def self.error_summary(e)
  if e.is_a? ChefApply::Error
    # By convention, all of our defined messages have a short summary on the first line.
    ChefApply::Text.errors.send(e.id).text(*e.params).split("\n").first
  elsif e.is_a? String
    e
  else
    if e.respond_to? :message
      e.message
    else
      ChefApply::Text.errors.UNKNOWN
    end
  end
end