Merge pull request #388 from dod-ccpo/raise-error-in-debug-mode

Raise unhandled exception in debug mode
This commit is contained in:
patricksmithdds 2018-10-16 15:31:53 -04:00 committed by GitHub
commit e7b437dc56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,4 @@
from flask import render_template from flask import render_template, current_app
import werkzeug.exceptions as werkzeug_exceptions import werkzeug.exceptions as werkzeug_exceptions
import atst.domain.exceptions as exceptions import atst.domain.exceptions as exceptions
@ -27,6 +27,8 @@ def make_error_pages(app):
# pylint: disable=unused-variable # pylint: disable=unused-variable
def exception(e): def exception(e):
log_error(e) log_error(e)
if current_app.debug:
raise e
return ( return (
render_template("error.html", message="An Unexpected Error Occurred"), render_template("error.html", message="An Unexpected Error Occurred"),
500, 500,