diff options
author | Christopher Larson <chris_larson@mentor.com> | 2015-08-24 15:32:00 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-09-04 16:23:59 +0100 |
commit | 7c4fdb8c178a2a48ee8c3a203dcac51b32c5ad1d (patch) | |
tree | 019b0df260fbcb4e4eea4fc5cbdcd57ce2466549 | |
parent | 5fe590cd6e60cba7b7f52826629e57e8ac67e195 (diff) | |
download | poky-7c4fdb8c178a2a48ee8c3a203dcac51b32c5ad1d.tar.gz |
bitbake: bb.cookerdata: include useful traceback for ExpansionError/ParseError
Show the user only the portion of the traceback which was from the metadata,
nothing from bitbake's internal calls.
(Bitbake rev: c45054aef03393fa0bf70e853ddcfc55988493cf)
Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | bitbake/lib/bb/cookerdata.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/bitbake/lib/bb/cookerdata.py b/bitbake/lib/bb/cookerdata.py index b20040c0b3..f19c283884 100644 --- a/bitbake/lib/bb/cookerdata.py +++ b/bitbake/lib/bb/cookerdata.py | |||
@@ -180,7 +180,16 @@ def catch_parse_error(func): | |||
180 | parselog.critical("Unable to parse %s: %s" % (fn, exc)) | 180 | parselog.critical("Unable to parse %s: %s" % (fn, exc)) |
181 | sys.exit(1) | 181 | sys.exit(1) |
182 | except (bb.parse.ParseError, bb.data_smart.ExpansionError) as exc: | 182 | except (bb.parse.ParseError, bb.data_smart.ExpansionError) as exc: |
183 | parselog.critical("Unable to parse %s: %s" % (fn, exc)) | 183 | import traceback |
184 | |||
185 | bbdir = os.path.dirname(__file__) + os.sep | ||
186 | exc_class, exc, tb = sys.exc_info() | ||
187 | for tb in iter(lambda: tb.tb_next, None): | ||
188 | # Skip frames in bitbake itself, we only want the metadata | ||
189 | fn, _, _, _ = traceback.extract_tb(tb, 1)[0] | ||
190 | if not fn.startswith(bbdir): | ||
191 | break | ||
192 | parselog.critical("Unable to parse %s", fn, exc_info=(exc_class, exc, tb)) | ||
184 | sys.exit(1) | 193 | sys.exit(1) |
185 | return wrapped | 194 | return wrapped |
186 | 195 | ||