* [PATCH] cookerdata: Improve handling of ParseError
@ 2016-03-28 17:04 Richard Purdie
0 siblings, 0 replies; only message in thread
From: Richard Purdie @ 2016-03-28 17:04 UTC (permalink / raw)
To: bitbake-devel; +Cc: Igor Stoppa
If local.conf contains an invalid line, e.g.:
APPEND += " igor"
(note the leading space) then nasty tracebacks are shown which confuse the
user. Change so the parse error is simply shown without a traceback, improving
the user experience.
[YOCTO #9332]
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
diff --git a/bitbake/lib/bb/cookerdata.py b/bitbake/lib/bb/cookerdata.py
index 9f40674..c5fdf66 100644
--- a/bitbake/lib/bb/cookerdata.py
+++ b/bitbake/lib/bb/cookerdata.py
@@ -182,7 +182,7 @@ def catch_parse_error(func):
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:
+ except bb.data_smart.ExpansionError as exc:
import traceback
bbdir = os.path.dirname(__file__) + os.sep
@@ -193,6 +193,8 @@ def catch_parse_error(func):
if not fn.startswith(bbdir):
break
parselog.critical("Unable to parse %s", fn, exc_info=(exc_class, exc, tb))
+ except bb.parse.ParseError as exc:
+ parselog.critical(str(exc))
sys.exit(1)
return wrapped
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2016-03-28 17:04 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-28 17:04 [PATCH] cookerdata: Improve handling of ParseError Richard Purdie
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.