summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorChris Larson <chris_larson@mentor.com>2011-05-05 16:50:34 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-06-08 20:38:24 +0100
commit36d1dcef6566e601d6b38a420b4e8103474cf018 (patch)
tree3022f32025b1f3e70c30176947f68bde490dd2ba /bitbake
parent2cf67a71e38bca2a2bf8f20c5143a006afb40276 (diff)
downloadpoky-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')
-rw-r--r--bitbake/lib/bb/cooker.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index fab65c22d5..ef42f02dab 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -33,7 +33,7 @@ import sre_constants
33import threading 33import threading
34from cStringIO import StringIO 34from cStringIO import StringIO
35from contextlib import closing 35from contextlib import closing
36import bb 36import bb, bb.exceptions
37from bb import utils, data, parse, event, cache, providers, taskdata, command, runqueue 37from bb import utils, data, parse, event, cache, providers, taskdata, command, runqueue
38 38
39logger = logging.getLogger("BitBake") 39logger = logging.getLogger("BitBake")
@@ -1122,8 +1122,7 @@ class ParsingFailure(Exception):
1122 def __init__(self, realexception, recipe): 1122 def __init__(self, realexception, recipe):
1123 self.realexception = realexception 1123 self.realexception = realexception
1124 self.recipe = recipe 1124 self.recipe = recipe
1125 Exception.__init__(self, "Failure when parsing %s" % recipe) 1125 Exception.__init__(self, realexception, recipe)
1126 self.args = (realexception, recipe)
1127 1126
1128def parse_file(task): 1127def parse_file(task):
1129 filename, appends, caches_array = task 1128 filename, appends, caches_array = task
@@ -1216,6 +1215,10 @@ class CookerParser(object):
1216 except KeyboardInterrupt: 1215 except KeyboardInterrupt:
1217 self.shutdown(clean=False) 1216 self.shutdown(clean=False)
1218 raise 1217 raise
1218 except ParsingFailure as exc:
1219 self.shutdown(clean=False)
1220 bb.fatal('Error parsing %s: %s' %
1221 (exc.recipe, bb.exceptions.to_string(exc.realexception)))
1219 except Exception as exc: 1222 except Exception as exc:
1220 self.shutdown(clean=False) 1223 self.shutdown(clean=False)
1221 bb.fatal('Error parsing %s: %s' % (exc.recipe, exc)) 1224 bb.fatal('Error parsing %s: %s' % (exc.recipe, exc))