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