exceptions.py 文件源码

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

项目:promenade 作者: att-comdev 项目源码 文件源码
def default_exception_handler(ex, req, resp, params):
    """
    Catch-all exception handler for standardized output.
    If this is a standard falcon HTTPError, rethrow it for handling
    """
    if isinstance(ex, falcon.HTTPError):
        # allow the falcon http errors to bubble up and get handled
        raise ex
    else:
        # take care of the uncaught stuff
        exc_string = traceback.format_exc()
        LOG.error('Unhanded Exception being handled: \n%s', exc_string)
        format_error_resp(
            req,
            resp,
            falcon.HTTP_500,
            error_type=ex.__class__.__name__,
            message="Unhandled Exception raised: %s" % str(ex),
            retry=True)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号