lib: drop all sentry exceptions when debug enabled

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-11-15 22:18:56 +01:00
parent 4b8b800648
commit 078633c2af
1 changed files with 3 additions and 0 deletions

View File

@ -8,6 +8,7 @@ from botocore.exceptions import BotoCoreError
from celery.exceptions import CeleryError from celery.exceptions import CeleryError
from channels.middleware import BaseMiddleware from channels.middleware import BaseMiddleware
from channels_redis.core import ChannelFull from channels_redis.core import ChannelFull
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured, SuspiciousOperation, ValidationError from django.core.exceptions import ImproperlyConfigured, SuspiciousOperation, ValidationError
from django.db import InternalError, OperationalError, ProgrammingError from django.db import InternalError, OperationalError, ProgrammingError
from django.http.response import Http404 from django.http.response import Http404
@ -107,4 +108,6 @@ def before_send(event: dict, hint: dict) -> Optional[dict]:
"django_redis", "django_redis",
]: ]:
return None return None
if settings.DEBUG:
return None
return event return event