lib: improve error handling for sentry

This commit is contained in:
Jens Langhammer 2020-09-15 11:29:43 +02:00
parent e95bbfab9a
commit 6b7da71aa8
1 changed files with 4 additions and 0 deletions

View File

@ -1,6 +1,7 @@
"""passbook sentry integration""" """passbook sentry integration"""
from billiard.exceptions import WorkerLostError from billiard.exceptions import WorkerLostError
from botocore.client import ClientError from botocore.client import ClientError
from celery.exceptions import CeleryError
from django.core.exceptions import DisallowedHost, ValidationError from django.core.exceptions import DisallowedHost, ValidationError
from django.db import InternalError, OperationalError, ProgrammingError from django.db import InternalError, OperationalError, ProgrammingError
from django_redis.exceptions import ConnectionInterrupted from django_redis.exceptions import ConnectionInterrupted
@ -8,6 +9,7 @@ from redis.exceptions import ConnectionError as RedisConnectionError
from redis.exceptions import RedisError from redis.exceptions import RedisError
from rest_framework.exceptions import APIException from rest_framework.exceptions import APIException
from structlog import get_logger from structlog import get_logger
from websockets.exceptions import WebSocketException
LOGGER = get_logger() LOGGER = get_logger()
@ -35,6 +37,8 @@ def before_send(event, hint):
OSError, OSError,
RedisError, RedisError,
SentryIgnoredException, SentryIgnoredException,
WebSocketException,
CeleryError,
) )
if "exc_info" in hint: if "exc_info" in hint:
_, exc_value, _ = hint["exc_info"] _, exc_value, _ = hint["exc_info"]