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))
评论列表
文章目录