class Async::Task
def fail!(exception = nil, propagate = true)
This is a very tricky aspect of tasks to get right. I've modelled it after `Thread` but it's slightly different in that the exception can propagate back up through the reactor. If the user writes code which raises an exception, that exception should always be visible, i.e. cause a failure. If it's not visible, such code fails silently and can be very difficult to debug.
def fail!(exception = nil, propagate = true) @status = :failed @result = exception if propagate raise elsif @finished.nil? # If no one has called wait, we log this as an error: Console.logger.error(self) {$!} else Console.logger.debug(self) {$!} end end