Module: Honeybadger::RakeHandler::Rake087Methods Private

Defined in:
lib/honeybadger/init/rake.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

This module brings Rake 0.8.7 error handling to 0.9.0 standards

Instance Method Summary collapse

Instance Method Details

#display_error_message(ex) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Method extracted from Rake 0.8.7 source



46
47
48
49
50
51
52
53
54
55
# File 'lib/honeybadger/init/rake.rb', line 46

def display_error_message(ex)
  warn "#{name} aborted!"
  warn ex.message
  if options.trace
    warn ex.backtrace.join("\n")
  else
    warn ex.backtrace.find { |str| str =~ /#{@rakefile}/ } || ""
    warn "(See full trace by running task with --trace)"
  end
end

#standard_exception_handlingObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Method taken from Rake 0.9.0 source

Provide standard exception handling for the given block.



31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/honeybadger/init/rake.rb', line 31

def standard_exception_handling
  yield
rescue SystemExit
  # Exit silently with current status
  raise
rescue OptionParser::InvalidOption => ex
  warn ex.message
  exit(false)
rescue => ex
  # Exit with error message
  display_error_message(ex)
  exit(false)
end