Merge pull request #44 from alphagov/production_exception_handling

Added exception handling for 500 error messages. Actually just logging added.
This commit is contained in:
Adam Shimali
2016-02-02 10:23:24 +00:00

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