diff options
author | Chris Larson <chris_larson@mentor.com> | 2011-05-05 16:50:34 -0700 |
---|---|---|
committer | Chris Larson <chris_larson@mentor.com> | 2011-05-16 12:39:42 -0700 |
commit | a41c217c6e9195f8b9ea2de6e1d335b10b904558 (patch) | |
tree | 61a834e7035a1189e4774aa82491024746c96567 /lib/bb | |
parent | dbf405f1f7fda41944093906c13044c6cf78f859 (diff) | |
download | bitbake-a41c217c6e9195f8b9ea2de6e1d335b10b904558.tar.gz |
cooker: show a useful message for ParsingFailure
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Diffstat (limited to 'lib/bb')
-rw-r--r-- | lib/bb/cooker.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py index 06912bde6..95b5db91f 100644 --- a/lib/bb/cooker.py +++ b/lib/bb/cooker.py @@ -33,7 +33,7 @@ import threading from cStringIO import StringIO from contextlib import closing from functools import wraps -import bb +import bb, bb.exceptions from bb import utils, data, parse, event, cache, providers, taskdata, command, runqueue logger = logging.getLogger("BitBake") @@ -1019,8 +1019,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 = task @@ -1116,6 +1115,10 @@ class CookerParser(object): except StopIteration: self.shutdown() return False + 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)) |