mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-30 14:31:57 -05:00
Log exception
This commit is contained in:
@@ -48,15 +48,15 @@ def register_errors(blueprint):
|
||||
|
||||
@blueprint.app_errorhandler(NoResultFound)
|
||||
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
|
||||
|
||||
@blueprint.app_errorhandler(DataError)
|
||||
def data_error(e):
|
||||
current_app.logger.error(str(e))
|
||||
current_app.logger.exception(e)
|
||||
return jsonify(result='error', message="No result found"), 404
|
||||
|
||||
@blueprint.app_errorhandler(SQLAlchemyError)
|
||||
def db_error(e):
|
||||
current_app.logger.error(str(e))
|
||||
current_app.logger.exception(e)
|
||||
return jsonify(result='error', message=str(e)), 500
|
||||
|
||||
Reference in New Issue
Block a user