summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/server/process.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2020-09-02 12:30:20 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-09-02 16:01:05 +0100
commita6709152e9788418e6c9431851437eb8ec4c6b46 (patch)
treed0c080d06de37c7ecf4b04ec108bc34c5fc09d76 /bitbake/lib/bb/server/process.py
parentd38276f55c1b97251e6847401f84a6f6dac47b87 (diff)
downloadpoky-a6709152e9788418e6c9431851437eb8ec4c6b46.tar.gz
bitbake: process/knotty: Improve early exception handling
The new server startup code means exceptions can happen when we aren't setup to show them to the user correctly, leading to ugly tracebacks. Add in some special case handling of BBHandledException to at least ensure that common case doesn't traceback and the user sees meaningful output. In the future, the logging setup can likely be improved, as can the way runCommand handles exceptions, they all should likely become real exceptions again on the UI side. [YOCTO #14022] [YOCTO #14033] (Bitbake rev: 6059d0e77f60ddb679049bd34478f41b1ab7995d) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/server/process.py')
-rw-r--r--bitbake/lib/bb/server/process.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/bitbake/lib/bb/server/process.py b/bitbake/lib/bb/server/process.py
index 4d3d1a4308..8699765a31 100644
--- a/bitbake/lib/bb/server/process.py
+++ b/bitbake/lib/bb/server/process.py
@@ -365,7 +365,12 @@ class ServerCommunicator():
365 logger.info("No reply from server in 30s") 365 logger.info("No reply from server in 30s")
366 if not self.recv.poll(30): 366 if not self.recv.poll(30):
367 raise ProcessTimeout("Timeout while waiting for a reply from the bitbake server (60s)") 367 raise ProcessTimeout("Timeout while waiting for a reply from the bitbake server (60s)")
368 return self.recv.get() 368 ret, exc = self.recv.get()
369 # Should probably turn all exceptions in exc back into exceptions?
370 # For now, at least handle BBHandledException
371 if exc and "BBHandledException" in exc:
372 raise bb.BBHandledException()
373 return ret, exc
369 374
370 def updateFeatureSet(self, featureset): 375 def updateFeatureSet(self, featureset):
371 _, error = self.runCommand(["setFeatures", featureset]) 376 _, error = self.runCommand(["setFeatures", featureset])