summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/cooker.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index 825c357988..ff16daf83f 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -948,6 +948,13 @@ class CookerExit(bb.event.Event):
948 def __init__(self): 948 def __init__(self):
949 bb.event.Event.__init__(self) 949 bb.event.Event.__init__(self)
950 950
951class ParsingFailure(Exception):
952 def __init__(self, realexception, recipe):
953 self.realexception = realexception
954 self.recipe = recipe
955 Exception.__init__(self, "Failure when parsing %s" % recipe)
956 self.args = (realexception, recipe)
957
951def parse_file(task): 958def parse_file(task):
952 filename, appends = task 959 filename, appends = task
953 try: 960 try:
@@ -955,6 +962,11 @@ def parse_file(task):
955 except Exception, exc: 962 except Exception, exc:
956 exc.recipe = filename 963 exc.recipe = filename
957 raise exc 964 raise exc
965 # Need to turn BaseExceptions into Exceptions here so we gracefully shutdown
966 # and for example a worker thread doesn't just exit on its own in response to
967 # a SystemExit event for example.
968 except BaseException, exc:
969 raise ParsingFailure(exc, filename)
958 970
959class CookerParser(object): 971class CookerParser(object):
960 def __init__(self, cooker, filelist, masked): 972 def __init__(self, cooker, filelist, masked):