Throw task_has_failed on errors.