route.py 文件源码

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

项目:valence 作者: openstack 项目源码 文件源码
def handle_error(self, error):
        if issubclass(error.__class__, exception.ValenceError):
            LOG.debug(traceback.format_exc())
            return utils.make_response(error.status, error.as_dict())
        elif hasattr(error, 'status'):
            LOG.debug(traceback.format_exc())
            return utils.make_response(error.code,
                                       exception.httpexception(error))
        else:
            # Valence will not throw general exception in normal case, so use
            # LOG.error() to record it.
            LOG.error(traceback.format_exc())
            exc = exception.generalexception(error,
                                             http_client.INTERNAL_SERVER_ERROR)
            return utils.make_response(http_client.INTERNAL_SERVER_ERROR, exc)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号