]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
cookerdata: Improve handling of ParseError
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 28 Mar 2016 17:04:10 +0000 (18:04 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 29 Mar 2016 22:20:40 +0000 (23:20 +0100)
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>
lib/bb/cookerdata.py

index 9f4067404ad275f876dc240e68acf914fd316306..c5fdf6637e979fa4791b44b9a900cd0d9adfefb6 100644 (file)
@@ -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