Created
November 12, 2014 15:51
-
-
Save rrafal/a21312d3c7edb80eb36f to your computer and use it in GitHub Desktop.
Filter request data read error in Django
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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