Go with the default error message used by BaseHTTPServer.BaseHTTPRequestHandler.send_...
commit4230ac09543210a5bd3d456126edb2c9259fb3e1
authorSimon Morgan <sjm@spamcop.net>
Sun, 19 Aug 2007 13:36:05 +0000 (19 14:36 +0100)
committerSimon Morgan <sjm@spamcop.net>
Sun, 19 Aug 2007 13:36:05 +0000 (19 14:36 +0100)
tree7f2191bed78599dcdb808ba810b21045a4317bd8
parent33ee21d3c8cdeb3f0418e471f68a7196a83f2cb9
Go with the default error message used by BaseHTTPServer.BaseHTTPRequestHandler.send_error rather than the one thrown by socket.error which, I think, is some kind of object which, when passed to send_error, results in another exception.
Exception happened during processing of request from ('127.0.0.1', 35444)
Traceback (most recent call last):
  File "/usr/lib/python2.5/SocketServer.py", line 222, in handle_request
    self.process_request(request, client_address)
  File "/usr/lib/python2.5/SocketServer.py", line 241, in process_request
    self.finish_request(request, client_address)
  File "/usr/lib/python2.5/SocketServer.py", line 254, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib/python2.5/SocketServer.py", line 522, in __init__
    self.handle()
  File "/usr/lib/python2.5/BaseHTTPServer.py", line 316, in handle
    self.handle_one_request()
  File "/usr/lib/python2.5/BaseHTTPServer.py", line 310, in handle_one_request
    method()
  File "cheatproxy.py", line 44, in do_GET
    if self._connect_to(netloc, soc):
  File "cheatproxy.py", line 75, in _connect_to
    self.send_error(502, msg)
  File "/usr/lib/python2.5/BaseHTTPServer.py", line 343, in send_error
    {'code': code, 'message': _quote_html(message), 'explain': explain})
  File "/usr/lib/python2.5/BaseHTTPServer.py", line 93, in _quote_html
    return html.replace("&", "&amp;").replace("<", "&lt;").replace(">", "&gt;")
AttributeError: 'gaierror' object has no attribute 'replace'
cheatproxy.py