resource.py 文件源码

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

项目:fluiddb 作者: fluidinfo 项目源码 文件源码
def _logInternalError(request, exception, fail, resourceClass):
    """
    Log a FluidDB internal error. Apart from doing the obvious things, we
    also pull all relevant tags off any Thrift error (our internal
    errors tend to come from calls we've made to the facade service via
    Thrift) and log them too.
    """
    log.msg('Request %s: Exception calling %r#deferred_render_%r ' %
            (request._fluidDB_reqid, resourceClass.__class__.__name__,
             request.method))
    log.msg(exception)
    traceback = fail.getTraceback()

    # If we get a CancelledError, we only log it as a warning, this is not a
    # sever error and it causes too much noise in the log files.
    if fail.check(CancelledError):
        logging.warning(traceback)
    else:
        logging.error(traceback)

    tags = thriftExceptions.get(exception.__class__)
    if tags:
        msg = []
        for tag in tags:
            msg.append('Failure tag %r: %r' %
                       (tag, getattr(exception, tag)))
        if msg:
            log.msg('\n'.join(msg))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号