httpserver: add error handler that write to the logger
PATCH 1/1 httpserver: add error handler that write to the logger
Signed-off-by Ross Burton <[email protected]>
--- meta/lib/oeqa/utils/httpserver.py | 6 ++++++ 1 file changed, 6 insertions(+)
meta/lib/oeqa/utils/httpserver.py +6 -0
@@ -44,6 +44,12 @@ class HTTPService: self.port = self.server.server_port self.process = multiprocessing.Process(target=self.server.server_start, args=[self.root_dir, self.logger]) + def handle_error(self, request, client_address): + import traceback + exception = traceback.format_exc() + self.logger.warn("Exception when handling %s: %s" % (request, exception)) + self.server.handle_error = handle_error + # The signal handler from testimage.bbclass can cause deadlocks here # if the HTTPServer is terminated before it can restore the standard #signal behaviour
Signature · 1 line
2.34.1