Method: Massimo::UI#report_errors

Defined in:
lib/massimo/ui.rb

#report_errorsObject

Run the given block and cleanly report any errors



35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/massimo/ui.rb', line 35

def report_errors
  begin
    yield
    true
  rescue Exception => error
    say 'massimo had a problem', :red
    indent do
      say error.message, :magenta
      say error.backtrace.first, :magenta
    end
    growl "#{error.message}\n#{error.backtrace.first}", 'massimo problem'
    false
  end
end