bitbake: bb.cookerdata: don't show traceback for ParseError/ExpansionError

Tracebacks are of extremely limited usefulness in this context. The exceptions
carry the necessary context already, and the user doesn't care about the calls
in bitbake internals that led to an expansion or parse failure.

(Bitbake rev: 9b95fa94eaae452ac7814f1e67c2f7a6314c52f1)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Christopher Larson authored and Richard Purdie committed 2015-08-01 22:24:19 +01:00
1 parent d2bf05fb55
commit 75fc6bf0a0
1 file changed
+5 -2
+5 -2
View File
@@ -173,9 +173,12 @@ def catch_parse_error(func):
def wrapped(fn, *args):
try:
return func(fn, *args)
except (IOError, bb.parse.ParseError, bb.data_smart.ExpansionError) as exc:
except IOError as exc:
import traceback
parselog.critical( traceback.format_exc())
parselog.critical(traceback.format_exc())
parselog.critical("Unable to parse %s: %s" % (fn, exc))
sys.exit(1)
except (bb.parse.ParseError, bb.data_smart.ExpansionError) as exc:
parselog.critical("Unable to parse %s: %s" % (fn, exc))
sys.exit(1)
return wrapped