add a HTTP 500 handler

This commit is contained in:
slice 2018-06-19 18:17:00 -07:00
parent c88148271d
commit f7d530c787
No known key found for this signature in database
GPG Key ID: 1508C19D7436A26D
1 changed files with 9 additions and 0 deletions

9
run.py
View File

@ -77,6 +77,15 @@ async def handle_litecord_err(err):
}), err.status_code }), err.status_code
@app.errorhandler(500)
async def handle_500(err):
return jsonify({
'error': True,
'message': repr(err),
'internal_server_error': True,
})
@app.route('/') @app.route('/')
async def index(): async def index():
return 'hewwo' return 'hewwo'