diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-09-02 12:30:20 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-09-02 12:34:16 +0100 |
commit | 6059d0e77f60ddb679049bd34478f41b1ab7995d (patch) | |
tree | 83d455523c9b1c41ac448728ca24905b5209e52c /lib/bb/server/process.py | |
parent | a73d45cb6010e14bf93fec857303bc7ff321066f (diff) | |
download | bitbake-6059d0e77f60ddb679049bd34478f41b1ab7995d.tar.gz |
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]
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/server/process.py')
-rw-r--r-- | lib/bb/server/process.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/bb/server/process.py b/lib/bb/server/process.py index 4d3d1a430..8699765a3 100644 --- a/lib/bb/server/process.py +++ b/lib/bb/server/process.py @@ -365,7 +365,12 @@ class ServerCommunicator(): logger.info("No reply from server in 30s") if not self.recv.poll(30): raise ProcessTimeout("Timeout while waiting for a reply from the bitbake server (60s)") - return self.recv.get() + ret, exc = self.recv.get() + # Should probably turn all exceptions in exc back into exceptions? + # For now, at least handle BBHandledException + if exc and "BBHandledException" in exc: + raise bb.BBHandledException() + return ret, exc def updateFeatureSet(self, featureset): _, error = self.runCommand(["setFeatures", featureset]) |