mirror of
https://git.yoctoproject.org/poky
synced 2026-05-31 12:49:46 +00:00
httpserver: add error handler that write to the logger
(From OE-Core rev: a4bcca3123685f410fc99e5cc23f2b8f39fd0a63) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
f6a1c8c309
commit
c24a83ed4a
@@ -44,6 +44,12 @@ class HTTPService:
|
|||||||
self.port = self.server.server_port
|
self.port = self.server.server_port
|
||||||
self.process = multiprocessing.Process(target=self.server.server_start, args=[self.root_dir, self.logger])
|
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
|
# The signal handler from testimage.bbclass can cause deadlocks here
|
||||||
# if the HTTPServer is terminated before it can restore the standard
|
# if the HTTPServer is terminated before it can restore the standard
|
||||||
#signal behaviour
|
#signal behaviour
|
||||||
|
|||||||
Reference in New Issue
Block a user