Skip to content

Commit 9c1cfc4

Browse files
author
Justus Pendleton
committed
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.
1 parent 6c8ca0a commit 9c1cfc4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

roundup/cgi/client.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: client.py,v 1.234 2007-08-27 10:27:31 richard Exp $
1+
# $Id: client.py,v 1.235 2007-09-11 21:30:14 jpend Exp $
22

33
"""WWW request handler (also used in the stand-alone server).
44
"""
@@ -287,7 +287,11 @@ def inner_main(self):
287287
self.additional_headers['Expires'] = rfc822.formatdate(date)
288288

289289
# render the content
290-
self.write_html(self.renderContext())
290+
try:
291+
self.write_html(self.renderContext())
292+
except IOError:
293+
# IOErrors here are due to the client disconnecting before recieving the reply.
294+
pass
291295

292296
except SeriousError, message:
293297
self.write_html(str(message))

0 commit comments

Comments
 (0)