mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-02 09:26:08 -05:00
Log exception
This commit is contained in:
@@ -48,15 +48,15 @@ def register_errors(blueprint):
|
|||||||
|
|
||||||
@blueprint.app_errorhandler(NoResultFound)
|
@blueprint.app_errorhandler(NoResultFound)
|
||||||
def no_result_found(e):
|
def no_result_found(e):
|
||||||
current_app.logger.error(str(e))
|
current_app.logger.exception(e)
|
||||||
return jsonify(result='error', message="No result found"), 404
|
return jsonify(result='error', message="No result found"), 404
|
||||||
|
|
||||||
@blueprint.app_errorhandler(DataError)
|
@blueprint.app_errorhandler(DataError)
|
||||||
def data_error(e):
|
def data_error(e):
|
||||||
current_app.logger.error(str(e))
|
current_app.logger.exception(e)
|
||||||
return jsonify(result='error', message="No result found"), 404
|
return jsonify(result='error', message="No result found"), 404
|
||||||
|
|
||||||
@blueprint.app_errorhandler(SQLAlchemyError)
|
@blueprint.app_errorhandler(SQLAlchemyError)
|
||||||
def db_error(e):
|
def db_error(e):
|
||||||
current_app.logger.error(str(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