예제 #1
0
def server_internal_error(error):
    import traceback
    errormsg = traceback.format_exc()
    errormsg = errormsg.replace('\n', '\r')
    logutil.log(level='ERROR', msg={'statuscode':500, 'description':errormsg})
    if request.path[:4] == '/up/' or request.path[:5] == '/api/':
        return f.failed(*const.SERVER_INTERNAL_ERROR)
    else:
        return f.web_failed(*const.SERVER_INTERNAL_ERROR)
예제 #2
0
def page_not_found(error):
    logutil.log(level='ERROR', msg={'description':'not found', 'statuscode':404})
    return render_template('404.html')