diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-10-09 17:39:20 +0100 |
---|---|---|
committer | Steve Sakoman <steve@sakoman.com> | 2021-11-22 04:14:27 -1000 |
commit | 80348b68a34b7ec45a0496a4af7f2ae0c26488f0 (patch) | |
tree | 204177cb38c3290e63892a528e5c6498ff32eee0 | |
parent | c0348de8121c3a842bf44906f7e2f79e93f7275b (diff) | |
download | bitbake-80348b68a34b7ec45a0496a4af7f2ae0c26488f0.tar.gz |
command: Ensure exceptions inheriting from BBHandledException are visible
Previous changes allowed BBHandledException to be detected but not exceptions
which inherit from it. Fix this. The code really needs totally reworking
to preserve the exceptions.
[YOCTO #14054]
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit ef762d92df6c2554c6248e80212f984d9ec4c651)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rw-r--r-- | lib/bb/command.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/bb/command.py b/lib/bb/command.py index 6abf38668..07128027f 100644 --- a/lib/bb/command.py +++ b/lib/bb/command.py @@ -74,8 +74,12 @@ class Command: result = command_method(self, commandline) except CommandError as exc: return None, exc.args[0] - except (Exception, SystemExit): + except (Exception, SystemExit) as exc: import traceback + if isinstance(exc, bb.BBHandledException): + # We need to start returning real exceptions here. Until we do, we can't + # tell if an exception is an instance of bb.BBHandledException + return None, "bb.BBHandledException()\n" + traceback.format_exc() return None, traceback.format_exc() else: return result, None |