views:

65

answers:

1

I'm running a Django site (via Apache/mod_python) and I use Django's facilities to inform me and other developers about internal server errors. Sometimes errors like those appear:

Traceback (most recent call last):

  File "/opt/webapp/externals/lib/django/core/handlers/base.py", line 92, in get_response
    response = callback(request, *callback_args, **callback_kwargs)

  File "/opt/webapp/csite/apps/customers/views.py", line 29, in feedback
    form = FeedbackForm(request.POST)

  File "/opt/webapp/externals/lib/django/core/handlers/modpython.py", line 113, in _get_post
    self._load_post_and_files()

  File "/opt/webapp/externals/lib/django/core/handlers/modpython.py", line 96, in _load_post_and_files
    self._post, self._files = http.QueryDict(self.raw_post_data, encoding=self._encoding), datastructures.MultiValueDict()

  File "/opt/webapp/externals/lib/django/core/handlers/modpython.py", line 163, in _get_raw_post_data
    self._raw_post_data = self._req.read()

IOError: Client read error (Timeout?)

As far as I found out, those IOErrors are generated by clients that disconnect in the wrong moment and that it's not a problem of my site.

If that is the case: Can I disable the emails for those errors somehow? I really don't want to know about errors that I cannot fix and that aren't really errors.

A: 

You should be able to write a Middleware to catch the exception and you can then "silence" those specific exceptions.

http://docs.djangoproject.com/en/1.1/topics/http/middleware/#process-exception

Brian Luft