@classmethod
def set_failed(cls, task_id, exception):
    """Mark task as failed after run - called by simulator.

        :param task_id: an ID of task that should be marked as failed
        :param exception: exception raised in task
        """
    cls.task_failures[task_id] = exception
