comparison mercurial/hgweb/server.py @ 13443:8fa83d7159eb stable

serve: catch and log all Exceptions, not only StandardException Other exceptions than StandardExceptions were left to the default error handler which was muted when running in daemon mode. Now all Exceptions are handled and logged to the log file.
author Mads Kiilerich <mads@kiilerich.com>
date Mon, 21 Feb 2011 00:52:23 +0100
parents 076bbbf0ba86
children 617a87cb7eb2
comparison
equal deleted inserted replaced
13442:bb107a31820e 13443:8fa83d7159eb
66 raise 66 raise
67 67
68 def do_POST(self): 68 def do_POST(self):
69 try: 69 try:
70 self.do_write() 70 self.do_write()
71 except StandardError: 71 except Exception:
72 self._start_response("500 Internal Server Error", []) 72 self._start_response("500 Internal Server Error", [])
73 self._write("Internal Server Error") 73 self._write("Internal Server Error")
74 tb = "".join(traceback.format_exception(*sys.exc_info())) 74 tb = "".join(traceback.format_exception(*sys.exc_info()))
75 self.log_error("Exception happened during processing " 75 self.log_error("Exception happened during processing "
76 "request '%s':\n%s", self.path, tb) 76 "request '%s':\n%s", self.path, tb)