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>2021-12-02 14:37:53 +0000
commit349e53d3cc898220742953c9976cb9ebc68e1a58 (patch)
tree44f11a9506e2d4c7ad4e07b2d9c279333fd2456f /bitbake/lib/bb/server/process.py
parent1db38c5a18952d949cd24ef354a1fee0aa1b63a0 (diff)
downloadpoky-349e53d3cc898220742953c9976cb9ebc68e1a58.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: 7fdd43c5cbde38daa013076de2fdedcf3c3d3107) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 6059d0e77f60ddb679049bd34478f41b1ab7995d) Signed-off-by: Steve Sakoman <steve@sakoman.com> 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 43061eb3c8..7b13576274 100644
--- a/bitbake/lib/bb/server/process.py
+++ b/bitbake/lib/bb/server/process.py
@@ -348,7 +348,12 @@ class ServerCommunicator():
348 logger.info("No reply from server in 30s") 348 logger.info("No reply from server in 30s")
349 if not self.recv.poll(30): 349 if not self.recv.poll(30):
350 raise ProcessTimeout("Timeout while waiting for a reply from the bitbake server (60s)") 350 raise ProcessTimeout("Timeout while waiting for a reply from the bitbake server (60s)")
351 return self.recv.get() 351 ret, exc = self.recv.get()
352 # Should probably turn all exceptions in exc back into exceptions?
353 # For now, at least handle BBHandledException
354 if exc and "BBHandledException" in exc:
355 raise bb.BBHandledException()
356 return ret, exc
352 357
353 def updateFeatureSet(self, featureset): 358 def updateFeatureSet(self, featureset):
354 _, error = self.runCommand(["setFeatures", featureset]) 359 _, error = self.runCommand(["setFeatures", featureset])