This repository has been archived on 2024-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
2019-04-29 17:16:49 +00:00
|
|
|
"""passbook sentry integration"""
|
|
|
|
|
|
|
|
|
|
|
|
def before_send(event, hint):
|
|
|
|
"""Check if error is database error, and ignore if so"""
|
2019-04-29 18:06:52 +00:00
|
|
|
from django.db import OperationalError
|
2019-04-29 17:16:49 +00:00
|
|
|
from django_redis.exceptions import ConnectionInterrupted
|
|
|
|
|
|
|
|
ignored_classes = [
|
|
|
|
OperationalError,
|
|
|
|
ConnectionInterrupted,
|
|
|
|
]
|
|
|
|
if 'exc_info' in hint:
|
|
|
|
_exc_type, exc_value, _ = hint['exc_info']
|
|
|
|
if isinstance(exc_value, ignored_classes):
|
|
|
|
return None
|
|
|
|
return event
|