mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 09:51:11 -05:00
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:
@@ -1,4 +1,4 @@
|
|||||||
from flask import jsonify
|
from flask import (jsonify, current_app)
|
||||||
|
|
||||||
from app.main import main
|
from app.main import main
|
||||||
|
|
||||||
@@ -32,5 +32,5 @@ def limit_exceeded(e):
|
|||||||
|
|
||||||
@main.app_errorhandler(500)
|
@main.app_errorhandler(500)
|
||||||
def internal_server_error(e):
|
def internal_server_error(e):
|
||||||
# TODO: log the error
|
current_app.logger.exception(e)
|
||||||
return jsonify(error="Internal error"), 500
|
return jsonify(error="Internal error"), 500
|
||||||
|
|||||||
Reference in New Issue
Block a user