mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-02 09:26:08 -05:00
- Remove different behaviour for debug mode in errors.py
This commit is contained in:
@@ -40,8 +40,6 @@ def register_errors(blueprint):
|
|||||||
|
|
||||||
@blueprint.app_errorhandler(500)
|
@blueprint.app_errorhandler(500)
|
||||||
def internal_server_error(e):
|
def internal_server_error(e):
|
||||||
if current_app.config.get('DEBUG'):
|
|
||||||
raise e
|
|
||||||
if isinstance(e, str):
|
if isinstance(e, str):
|
||||||
current_app.logger.exception(e)
|
current_app.logger.exception(e)
|
||||||
elif isinstance(e, Exception):
|
elif isinstance(e, Exception):
|
||||||
@@ -60,7 +58,5 @@ def register_errors(blueprint):
|
|||||||
|
|
||||||
@blueprint.app_errorhandler(SQLAlchemyError)
|
@blueprint.app_errorhandler(SQLAlchemyError)
|
||||||
def db_error(e):
|
def db_error(e):
|
||||||
if current_app.config.get('DEBUG'):
|
|
||||||
raise e
|
|
||||||
current_app.logger.exception(e)
|
current_app.logger.exception(e)
|
||||||
return jsonify(result='error', message=str(e)), 500
|
return jsonify(result='error', message=str(e)), 500
|
||||||
|
|||||||
Reference in New Issue
Block a user