Added exception handling for 500 error messages.

This commit is contained in:
Nicholas Staples
2016-02-01 10:19:17 +00:00
parent 2bd244032b
commit 47351b2009

View File

@@ -1,4 +1,4 @@
from flask import jsonify
from flask import (jsonify, current_app)
from app.main import main
@@ -32,5 +32,5 @@ def limit_exceeded(e):
@main.app_errorhandler(500)
def internal_server_error(e):
# TODO: log the error
current_app.logger.exception(e)
return jsonify(error="Internal error"), 500