Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Trying to surpress annoying ioerror-request-data-read-error

  • Loading branch information...
commit 75e09aceb601b8df0ce36a67cb0eb3a2d16b57cd 1 parent 3986c7b
David Burke authored
View
0  common/__init__.py
No changes.
View
10 common/logging.py
@@ -0,0 +1,10 @@
+import sys, traceback
+
+class SuppressUnreadablePost(object):
+ def filter(self, record):
+ _, exception, tb = sys.exc_info()
+ if isinstance(exception, IOError):
+ for _, _, function, _ in traceback.extract_tb(tb):
+ if function == '_get_raw_post_data':
+ return False
+ return True
View
13 django_sis/settings.py
@@ -267,20 +267,19 @@ def skip_unreadable_post(record):
},
},
'filters': {
- 'skip_unreadable_posts': {
- '()': 'django.utils.log.CallbackFilter',
- 'callback': skip_unreadable_post,
- }
-},
+ 'supress_unreadable_post': {
+ '()': 'common.logging.SuppressUnreadablePost',
+ }
+ },
'handlers': {
'sentry': {
'level': 'WARNING',
- 'filters': ['skip_unreadable_posts'],
+ 'filters': ['supress_unreadable_post'],
'class': 'raven.contrib.django.handlers.SentryHandler',
},
'console': {
'level': 'DEBUG',
- 'filters': ['skip_unreadable_posts'],
+ 'filters': ['supress_unreadable_post'],
'class': 'logging.StreamHandler',
'formatter': 'verbose'
},
Please sign in to comment.
Something went wrong with that request. Please try again.