mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 23:55:58 -05:00
celery test cleanup
* Alter config so an error will be raised if you forget to mock out a celery call in one of your tests * Remove an unneeded exception type that was masking errors
This commit is contained in:
@@ -5,7 +5,6 @@ from sqlalchemy.exc import DataError
|
||||
from sqlalchemy.orm.exc import NoResultFound
|
||||
from app.authentication.auth import AuthError
|
||||
from app.errors import InvalidRequest
|
||||
from app.notifications import SendNotificationToQueueError
|
||||
|
||||
|
||||
class TooManyRequestsError(InvalidRequest):
|
||||
@@ -61,13 +60,6 @@ def register_errors(blueprint):
|
||||
def auth_error(error):
|
||||
return jsonify(error.to_dict_v2()), error.code
|
||||
|
||||
@blueprint.errorhandler(SendNotificationToQueueError)
|
||||
def failed_to_create_notification(error):
|
||||
current_app.logger.exception(error)
|
||||
return jsonify(
|
||||
status_code=500,
|
||||
errors=[{"error": error.__class__.__name__, "message": error.message}]), 500
|
||||
|
||||
@blueprint.errorhandler(Exception)
|
||||
def internal_server_error(error):
|
||||
current_app.logger.exception(error)
|
||||
|
||||
Reference in New Issue
Block a user