Module: Dispatch::Rails::RakeHandler

Defined in:
lib/dispatch/rails/rake_handler.rb

Overview

Captures rake task failures. Rake rescues the exception itself (display_error_message, then exit(false)), so the at_exit hook only ever sees SystemExit — this is the one place the real exception is visible, with the failing command attached. Capture enqueues; the at_exit flush drains the queue before the process dies.

Instance Method Summary collapse

Instance Method Details

#display_error_message(ex) ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/dispatch/rails/rake_handler.rb', line 9

def display_error_message(ex)
  Dispatch::Rails::Reporter.capture(
    ex,
    handled: false,
    context: { tags: { source: "rake", command: "rake #{ARGV.join(' ')}".strip } }
  )
  super
end