Now that we have discovered that the catch all Exception handler doesn't work, I've created a custom exception (SendNotificationQueueError) that handles this case and an error handler for it.

Talked these through with @becca as an approach.
This commit is contained in:
Martyn Inglis
2016-11-21 15:11:19 +00:00
parent 7cfc58c994
commit 58bbc5a5aa
6 changed files with 27 additions and 8 deletions

View File

@@ -242,10 +242,7 @@ def send_notification(notification_type):
notification_type=notification_type,
api_key_id=api_user.id,
key_type=api_user.key_type)
try:
send_notification_to_queue(saved_notification, service.research_mode)
except Exception as e:
return jsonify(result='error', message="Internal server error"), 500
send_notification_to_queue(saved_notification, service.research_mode)
notification_id = create_uuid() if saved_notification is None else saved_notification.id
notification.update({"template_version": template.version})