class Async::Task
def failed!(exception = false, propagate = true)
def failed!(exception = false, propagate = true) @result = exception @status = :failed if exception if propagate raise exception elsif @finished.nil? # If no one has called wait, we log this as a warning: Console::Event::Failure.for(exception).emit(self, "Task may have ended with unhandled exception.", severity: :warn) else Console::Event::Failure.for(exception).emit(self, severity: :debug) end end end