lib/sentry: fix SentryIgnoredException not being ignored correctly

This commit is contained in:
Jens Langhammer 2020-02-24 16:58:26 +01:00
parent 8388120b06
commit f1f4cbef9b
1 changed files with 4 additions and 2 deletions

View File

@ -32,11 +32,13 @@ def before_send(event, hint):
ValidationError,
OSError,
RedisError,
SentryIgnoredException,
)
if "exc_info" in hint:
_exc_type, exc_value, _ = hint["exc_info"]
if isinstance(exc_value, ignored_classes):
# pylint: disable=consider-merging-isinstance
if isinstance(exc_value, ignored_classes) or isinstance(
exc_value, SentryIgnoredException
):
LOGGER.info("Supressing error %r", exc_value)
return None
return event