diff --git a/passbook/lib/sentry.py b/passbook/lib/sentry.py index 453df529e..f50b612aa 100644 --- a/passbook/lib/sentry.py +++ b/passbook/lib/sentry.py @@ -1,4 +1,11 @@ """passbook sentry integration""" +from billiard.exceptions import WorkerLostError +from botocore.client import ClientError +from django.core.exceptions import DisallowedHost, ValidationError +from django.db import InternalError, OperationalError, ProgrammingError +from django_redis.exceptions import ConnectionInterrupted +from redis.exceptions import RedisError +from rest_framework.exceptions import APIException from structlog import get_logger LOGGER = get_logger() @@ -10,20 +17,12 @@ class SentryIgnoredException(Exception): def before_send(event, hint): """Check if error is database error, and ignore if so""" - from django_redis.exceptions import ConnectionInterrupted - from django.db import OperationalError, InternalError - from django.core.exceptions import ValidationError - from rest_framework.exceptions import APIException - from billiard.exceptions import WorkerLostError - from django.core.exceptions import DisallowedHost - from botocore.client import ClientError - from redis.exceptions import RedisError - ignored_classes = ( OperationalError, + InternalError, + ProgrammingError, ConnectionInterrupted, APIException, - InternalError, ConnectionResetError, WorkerLostError, DisallowedHost,