Method: ChefApply::UI::ErrorPrinter.show_error

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

.show_error(e) ⇒ Object



38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/chef_apply/ui/error_printer.rb', line 38

def self.show_error(e)
  # Name is misleading - it's unwrapping but also doing further
  # error resolution for common errors:
  unwrapped = ChefApply::Errors::StandardErrorResolver.unwrap_exception(e)
  if unwrapped.class == ChefApply::MultiJobFailure
    capture_multiple_failures(unwrapped)
  end
  formatter = ErrorPrinter.new(e, unwrapped)
  Terminal.output(formatter.format_error)
rescue => e
  dump_unexpected_error(e)
end