module Honeybadger::RakeHandler::Rake087Methods

def display_error_message(ex)

Method extracted from Rake 0.8.7 source
def display_error_message(ex)
  $stderr.puts "#{name} aborted!"
  $stderr.puts ex.message
  if options.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

def standard_exception_handling

Provide standard exception handling for the given block.

Method taken from Rake 0.9.0 source
def standard_exception_handling
  begin
    yield
  rescue SystemExit => ex
    # Exit silently with current status
    raise
  rescue OptionParser::InvalidOption => ex
    $stderr.puts ex.message
    exit(false)
  rescue Exception => ex
    # Exit with error message
    display_error_message(ex)
    exit(false)
  end
end