class Rake::Application

def execute(*)

def execute(*)
  exception = DEBUGGER__::SESSION.capture_exception_frames(/(exe|bin|lib)\/rake/) do
    super
  end
  if exception
    STDERR.puts exception.message
    DEBUGGER__::SESSION.enter_postmortem_session exception
    raise exception
  end
end