separate passbook.core into passbook.root and passbook.core

Move Main Django Project into passbook.root while passbook.core holds core functionality.

passbook.root contains main settings, ASGI & WSGI, celery and URLs.
This commit is contained in:
Jens Langhammer
2019-06-25 18:00:54 +02:00
parent 3b2c2d781f
commit a798412e17
16 changed files with 69 additions and 50 deletions

View File

@ -1,17 +1,29 @@
"""passbook sentry integration"""
from logging import getLogger
LOGGER = getLogger(__name__)
def before_send(event, hint):
"""Check if error is database error, and ignore if so"""
from django.db import OperationalError
from django_redis.exceptions import ConnectionInterrupted
ignored_classes = [
from django.db import OperationalError, InternalError
from rest_framework.exceptions import APIException
from billiard.exceptions import WorkerLostError
from django.core.exceptions import DisallowedHost
ignored_classes = (
OperationalError,
ConnectionInterrupted,
]
APIException,
InternalError,
ConnectionResetError,
WorkerLostError,
DisallowedHost,
ConnectionResetError,
)
if 'exc_info' in hint:
_exc_type, exc_value, _ = hint['exc_info']
if isinstance(exc_value, ignored_classes):
LOGGER.info("Supressing error %r", exc_value)
return None
return event