예제 #1
0
def value_error(e):
    log.warn('服务发生异常: [error: %s]' % (e, ), exc_info=True)
    return render_template('/exception/except.html',
                           status_coder=500,
                           title='服务异常',
                           content='服务发生异常: [error: %s]' % e)
예제 #2
0
def internal_server_error(e):
    log.warn('内部服务发生异常: [error: %s]' % (e, ), exc_info=True)
    return render_template('/exception/except.html',
                           status_coder=500,
                           title='服务器内部错误',
                           content='内部服务发生异常: [error: %s]' % e)
예제 #3
0
def bad_request(e):
    log.warn('错误的请求参数: [error: %s]' % (e, ), exc_info=True)
    return render_template('/exception/except.html',
                           status_coder=400,
                           title='参数错误',
                           content='错误的请求参数: [error: %s]' % e)
예제 #4
0
def page_not_found(e):
    log.warn('访问了未知路径: [error: %s]' % (e, ), exc_info=True)
    return render_template('/exception/except.html',
                           status_coder=404,
                           title='资源未找到',
                           content='访问了未知路径: [error: %s]' % e)
예제 #5
0
def value_error(e):
    log.warn('服务发生异常: [error: %s]' % (e, ), exc_info=True)
    return {'status': 500, 'msg': '失败'}, 500
예제 #6
0
def resource_internal_server_error(e):
    log.warn('服务发生异常: [error: %s]' % (e, ), exc_info=True)
    return {'status': 500, 'msg': '失败'}, 500