changeset 3896:fca0365521fc

ignore client shutdown exceptions when sending responses patch from Ulrik Miaelsson If the user clicks the stop button, or click another link before the previous has finished loading, or something similar an IOError exception will be raised which results in the admin being sent an email. This can understandably be pretty annoying if your users are doing that on a regular basis. So we'll trap that exception and ignore it.
author Justus Pendleton <jpend@users.sourceforge.net>
date Tue, 11 Sep 2007 21:30:14 +0000
parents fa611c224895
children e2c2d91932ad
files roundup/cgi/client.py
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/roundup/cgi/client.py	Tue Sep 11 21:28:29 2007 +0000
+++ b/roundup/cgi/client.py	Tue Sep 11 21:30:14 2007 +0000
@@ -1,4 +1,4 @@
-# $Id: client.py,v 1.234 2007-08-27 10:27:31 richard Exp $
+# $Id: client.py,v 1.235 2007-09-11 21:30:14 jpend Exp $
 
 """WWW request handler (also used in the stand-alone server).
 """
@@ -287,7 +287,11 @@
             self.additional_headers['Expires'] = rfc822.formatdate(date)
 
             # render the content
-            self.write_html(self.renderContext())
+            try:
+                self.write_html(self.renderContext())
+            except IOError:
+                # IOErrors here are due to the client disconnecting before recieving the reply.
+                pass
 
         except SeriousError, message:
             self.write_html(str(message))

Roundup Issue Tracker: http://roundup-tracker.org/