_exception.py 文件源码

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

项目:txkube 作者: LeastAuthority 项目源码 文件源码
def from_model_and_response(cls, model, response):
        """
        Create a ``KubernetesError`` for the given error response from a
        Kubernetes server.

        :param model: The Kubernetes data model to use to convert the server
            response into a Python object.

        :param twisted.web.iweb.IResponse response: The response to inspect
            for the error details.

        :return Deferred(KubernetesError): The error with details attached.
        """
        d = readBody(response)
        d.addCallback(
            lambda body: cls(
                response.code,
                model.iobject_from_raw(loads(body)),
            ),
        )
        return d
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号