summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@arm.com>2023-01-31 16:30:22 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-02-01 13:59:56 +0000
commita4bcca3123685f410fc99e5cc23f2b8f39fd0a63 (patch)
treecec67b5d8ab46ec606c380ef4e9a9eef366a62e8 /meta
parent8fc939d942cec1662ca386b87c63f167bb10fd05 (diff)
downloadopenembedded-core-a4bcca3123685f410fc99e5cc23f2b8f39fd0a63.tar.gz
httpserver: add error handler that write to the logger
Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/lib/oeqa/utils/httpserver.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/meta/lib/oeqa/utils/httpserver.py b/meta/lib/oeqa/utils/httpserver.py
index 2aa172bf79..80752c1377 100644
--- a/meta/lib/oeqa/utils/httpserver.py
+++ b/meta/lib/oeqa/utils/httpserver.py
@@ -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