Class: Omnibus::Builder::ErrorReporter

Inherits:
Object
  • Object
show all
Defined in:
lib/omnibus/builder.rb

Overview

TODO:

code duplication with Fetcher::ErrorReporter

TODO:

make this use the logger

Instance Method Summary collapse

Constructor Details

#initialize(error, fetcher) ⇒ ErrorReporter

TODO:

fetcher isn’t even used

Returns a new instance of ErrorReporter.



71
72
73
# File 'lib/omnibus/builder.rb', line 71

def initialize(error, fetcher)
  @error, @fetcher = error, fetcher
end

Instance Method Details

#eObject

TODO:

this isn’t necessary



76
77
78
# File 'lib/omnibus/builder.rb', line 76

def e
  @error
end

#explain(why) ⇒ Object



80
81
82
83
84
85
86
87
# File 'lib/omnibus/builder.rb', line 80

def explain(why)
  $stderr.puts '* ' * 40
  $stderr.puts why
  $stderr.puts 'Exception:'
  $stderr.puts indent("#{e.class}: #{e.message.strip}", 2)
  Array(e.backtrace).each { |l| $stderr.puts indent(l, 4) }
  $stderr.puts '* ' * 40
end