Module: Honeybadger::RakeHandler::Rake087Methods
- Defined in:
- lib/honeybadger/init/rake.rb
Overview
This module brings Rake 0.8.7 error handling to 0.9.0 standards
Instance Method Summary collapse
-
#display_error_message(ex) ⇒ Object
Method extracted from Rake 0.8.7 source.
-
#standard_exception_handling ⇒ Object
Method taken from Rake 0.9.0 source.
Instance Method Details
#display_error_message(ex) ⇒ Object
Method extracted from Rake 0.8.7 source
47 48 49 50 51 52 53 54 55 56 |
# File 'lib/honeybadger/init/rake.rb', line 47 def (ex) $stderr.puts "#{name} aborted!" $stderr.puts ex. if .trace $stderr.puts ex.backtrace.join("\n") else $stderr.puts ex.backtrace.find {|str| str =~ /#{@rakefile}/ } || "" $stderr.puts "(See full trace by running task with --trace)" end end |
#standard_exception_handling ⇒ Object
Method taken from Rake 0.9.0 source
Provide standard exception handling for the given block.
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/honeybadger/init/rake.rb', line 30 def standard_exception_handling begin yield rescue SystemExit => ex # Exit silently with current status raise rescue OptionParser::InvalidOption => ex $stderr.puts ex. exit(false) rescue Exception => ex # Exit with error message (ex) exit(false) end end |