diff options
author | Chris Larson <chris_larson@mentor.com> | 2011-05-05 16:50:34 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-06-08 20:38:24 +0100 |
commit | 36d1dcef6566e601d6b38a420b4e8103474cf018 (patch) | |
tree | 3022f32025b1f3e70c30176947f68bde490dd2ba /bitbake/lib | |
parent | 2cf67a71e38bca2a2bf8f20c5143a006afb40276 (diff) | |
download | ast2050-yocto-poky-36d1dcef6566e601d6b38a420b4e8103474cf018.zip ast2050-yocto-poky-36d1dcef6566e601d6b38a420b4e8103474cf018.tar.gz |
cooker: show a useful message for ParsingFailure
(Bitbake rev: a41c217c6e9195f8b9ea2de6e1d335b10b904558)
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r-- | bitbake/lib/bb/cooker.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index fab65c2..ef42f02 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py @@ -33,7 +33,7 @@ import sre_constants import threading from cStringIO import StringIO from contextlib import closing -import bb +import bb, bb.exceptions from bb import utils, data, parse, event, cache, providers, taskdata, command, runqueue logger = logging.getLogger("BitBake") @@ -1122,8 +1122,7 @@ class ParsingFailure(Exception): def __init__(self, realexception, recipe): self.realexception = realexception self.recipe = recipe - Exception.__init__(self, "Failure when parsing %s" % recipe) - self.args = (realexception, recipe) + Exception.__init__(self, realexception, recipe) def parse_file(task): filename, appends, caches_array = task @@ -1216,6 +1215,10 @@ class CookerParser(object): except KeyboardInterrupt: self.shutdown(clean=False) raise + except ParsingFailure as exc: + self.shutdown(clean=False) + bb.fatal('Error parsing %s: %s' % + (exc.recipe, bb.exceptions.to_string(exc.realexception))) except Exception as exc: self.shutdown(clean=False) bb.fatal('Error parsing %s: %s' % (exc.recipe, exc)) |