summaryrefslogtreecommitdiffstats
path: root/roles/mailman/files/django_fedora.py
blob: b8cda8a0777dfb9e9f503433da0cdee1c874ee86 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from django.http import UnreadablePostError
from pylibmc import Error as MemcachedError

EXCLUDED = (
    UnreadablePostError,
    MemcachedError,
)

def exclude_useless_errors(record):
    if record.exc_info:
        exc_type, exc_value = record.exc_info[:2]
        for excluded_class in EXCLUDED:
            if isinstance(exc_value, excluded_class):
                return False
    return True