From 4dbd1e2ecab32403e845502d8e03ca973e7d4191 Mon Sep 17 00:00:00 2001 From: Charlton Austin Date: Mon, 22 May 2017 11:32:28 -0400 Subject: [PATCH] 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 --- workers/notificationworker.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/workers/notificationworker.py b/workers/notificationworker.py index 67dd2fff0..718b770b8 100644 --- a/workers/notificationworker.py +++ b/workers/notificationworker.py @@ -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