def _send_exception(self): lines = logger.get_exception_as_lines() for line in lines: logger.error(line) self.send_response(HttpCodes.OK) self.send_header("Content-type", "text/html") self.send_header("Server", self.SERVER_NAME) self.end_headers() self.wfile.write("<html><body><h1>Midge Error!</h1>") self.wfile.write("It would appear that Midge is not completely " "free of bugs...") self.wfile.write("<blockquote><pre>") for line in lines: self.wfile.write(line) self.wfile.write("\n") self.wfile.write("</pre></blockquote></body></html>")