Class: Omnibus::Builder::ErrorReporter
- Inherits:
-
Object
- Object
- Omnibus::Builder::ErrorReporter
- Defined in:
- lib/omnibus/builder.rb
Overview
TODO:
code duplication with Fetcher::ErrorReporter
TODO:
make this use the logger
Instance Method Summary collapse
- #e ⇒ Object
- #explain(why) ⇒ Object
-
#initialize(error, fetcher) ⇒ ErrorReporter
constructor
A new instance of ErrorReporter.
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
#e ⇒ Object
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..strip}", 2) Array(e.backtrace).each { |l| $stderr.puts indent(l, 4) } $stderr.puts '* ' * 40 end |