fix(notification_worker): added in correct exception catching

before we were not catching the correct exception

[TESTING -> locally using docker]

Issue: https://www.pivotaltracker.com/story/show/144646649

- [ ] It works!
- [ ] Comments provide sufficient explanations for the next contributor
- [ ] Tests cover changes and corner cases
- [ ] Follows Quay syntax patterns and format
This commit is contained in:
Charlton Austin 2017-05-22 11:32:28 -04:00
parent a71f60a9c1
commit 4dbd1e2eca

View file

@ -1,3 +1,5 @@
import logging
from app import notification_queue
from data.model.notification import increment_notification_failure_count, reset_number_of_failures_to_zero
@ -8,7 +10,7 @@ from workers.queueworker import QueueWorker, JobException
from data import model
from data.model import InvalidNotificationException
logger = logging.getLogger(__name__)
class NotificationWorker(QueueWorker):
@ -37,7 +39,7 @@ class NotificationWorker(QueueWorker):
try:
method_handler.perform(notification, event_handler, job_details)
reset_number_of_failures_to_zero(notification.id)
except (NotificationMethod, KeyError) as exc:
except (JobException, KeyError) as exc:
increment_notification_failure_count(notification.id)
raise exc