activities.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:heaviside 作者: jhuapl-boss 项目源码 文件源码
def failure(self, error, cause):
        """Marks the task as a failure with a given reason

        Note: This method will silently fail if the task has timed out

        Args:
            error (string): Failure error
            cause (string): Failure error cause
        """
        if self.token is None:
            raise Exception("Not currently working on a task")

        try:
            resp = self.client.send_task_failure(taskToken = self.token,
                                                 error = error,
                                                 cause = cause)
        except ClientError as e:
            # eat the timeout
            if not self.is_timeout(e):
                self.log.exception("Eror sending task failure")
                raise
        finally:
            self.token = None # finished with task
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号