diff options
author | Ross Burton <ross.burton@arm.com> | 2023-01-31 16:30:22 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-02-01 13:59:56 +0000 |
commit | a4bcca3123685f410fc99e5cc23f2b8f39fd0a63 (patch) | |
tree | cec67b5d8ab46ec606c380ef4e9a9eef366a62e8 /meta/lib | |
parent | 8fc939d942cec1662ca386b87c63f167bb10fd05 (diff) | |
download | openembedded-core-contrib-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/lib')
-rw-r--r-- | meta/lib/oeqa/utils/httpserver.py | 6 |
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 |