Merge pull request #2657 from charltonaustin/fix_disable_notification

fix(notification_worker): added in correct exception catching
This commit is contained in:
Charlton Austin 2017-05-22 12:17:44 -04:00 committed by GitHub
commit d122743129

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