activities.py 文件源码

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

项目:heaviside 作者: jhuapl-boss 项目源码 文件源码
def is_timeout(ex, op_name=None):
        """Check the exception to determine if it is a Boto3 ClientError
        thrown because the task timed out.

        Args:
            ex (Exception) : Exception to check
            op_name (string|None) : (Optional) name of the operation that was attempted

        Returns:
            bool : If the exception was caused by the task timing out
        """
        try:
            rst = ex.response['Error']['Code'] == 'TaskTimedOut'
            if op_name:
                rst &= ex.operation_name == op_name
            return rst
        except:
            return False
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号