Skip to content

Instantly share code, notes, and snippets.

@rrafal
Created November 12, 2014 15:51
Show Gist options
  • Save rrafal/a21312d3c7edb80eb36f to your computer and use it in GitHub Desktop.
Save rrafal/a21312d3c7edb80eb36f to your computer and use it in GitHub Desktop.
Filter request data read error in Django
class IgnoreRequestDataReadError(logging.Filter):
def filter(self, record):
if record.exc_info:
exc_value = record.exc_info[1]
if isinstance(exc_value, IOError) and unicode(exc_value) == 'request data read error':
return False
return True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment