Mercurial > p > roundup > code
comparison roundup/cgi/client.py @ 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 | 2563ddf71cd7 |
| children | dd00c917fc40 |
comparison
equal
deleted
inserted
replaced
| 3895:fa611c224895 | 3896:fca0365521fc |
|---|---|
| 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 $ |
| 2 | 2 |
| 3 """WWW request handler (also used in the stand-alone server). | 3 """WWW request handler (also used in the stand-alone server). |
| 4 """ | 4 """ |
| 5 __docformat__ = 'restructuredtext' | 5 __docformat__ = 'restructuredtext' |
| 6 | 6 |
| 285 #else: | 285 #else: |
| 286 # date = time.time() + 5 | 286 # date = time.time() + 5 |
| 287 self.additional_headers['Expires'] = rfc822.formatdate(date) | 287 self.additional_headers['Expires'] = rfc822.formatdate(date) |
| 288 | 288 |
| 289 # render the content | 289 # 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 | |
| 291 | 295 |
| 292 except SeriousError, message: | 296 except SeriousError, message: |
| 293 self.write_html(str(message)) | 297 self.write_html(str(message)) |
| 294 except Redirect, url: | 298 except Redirect, url: |
| 295 # let's redirect - if the url isn't None, then we need to do | 299 # let's redirect - if the url isn't None, then we need to do |
