lib: add more errors to sentry ignore

This commit is contained in:
Jens Langhammer 2020-02-23 19:48:14 +01:00
parent 64d7b009ab
commit a8926cbd07

View file

@ -1,4 +1,11 @@
"""passbook sentry integration""" """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 from structlog import get_logger
LOGGER = get_logger() LOGGER = get_logger()
@ -10,20 +17,12 @@ class SentryIgnoredException(Exception):
def before_send(event, hint): def before_send(event, hint):
"""Check if error is database error, and ignore if so""" """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 = ( ignored_classes = (
OperationalError, OperationalError,
InternalError,
ProgrammingError,
ConnectionInterrupted, ConnectionInterrupted,
APIException, APIException,
InternalError,
ConnectionResetError, ConnectionResetError,
WorkerLostError, WorkerLostError,
DisallowedHost, DisallowedHost,