wsgi.py 文件源码

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

项目:bilean 作者: openstack 项目源码 文件源码
def translate_exception(exc, locale):
    """Translates all translatable elements of the given exception."""
    if isinstance(exc, exception.BileanException):
        exc.message = oslo_i18n.translate(exc.message, locale)
    else:
        exc.message = oslo_i18n.translate(six.text_type(exc), locale)

    if isinstance(exc, webob.exc.HTTPError):
        exc.explanation = oslo_i18n.translate(exc.explanation, locale)
        exc.detail = oslo_i18n.translate(getattr(exc, 'detail', ''), locale)
    return exc
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号