http.py 文件源码

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

项目:osc-placement 作者: openstack 项目源码 文件源码
def _wrap_http_exceptions():
    """Reraise osc-lib exceptions with detailed messages."""

    try:
        yield
    except ks_exceptions.HttpError as exc:
        detail = json.loads(exc.response.content)['errors'][0]['detail']
        msg = detail.split('\n')[-1].strip()
        exc_class = _http_error_to_exc.get(exc.http_status,
                                           exceptions.CommandError)

        six.raise_from(exc_class(exc.http_status, msg), exc)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号