diff options
Diffstat (limited to 'bitbake/lib/bb/cooker.py')
-rw-r--r-- | bitbake/lib/bb/cooker.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index ef42f02dab..658a7b0657 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py | |||
@@ -1129,7 +1129,9 @@ def parse_file(task): | |||
1129 | try: | 1129 | try: |
1130 | return True, bb.cache.Cache.parse(filename, appends, parse_file.cfg, caches_array) | 1130 | return True, bb.cache.Cache.parse(filename, appends, parse_file.cfg, caches_array) |
1131 | except Exception, exc: | 1131 | except Exception, exc: |
1132 | tb = sys.exc_info()[2] | ||
1132 | exc.recipe = filename | 1133 | exc.recipe = filename |
1134 | exc.traceback = list(bb.exceptions.extract_traceback(tb, context=3)) | ||
1133 | raise exc | 1135 | raise exc |
1134 | # Need to turn BaseExceptions into Exceptions here so we gracefully shutdown | 1136 | # Need to turn BaseExceptions into Exceptions here so we gracefully shutdown |
1135 | # and for example a worker thread doesn't just exit on its own in response to | 1137 | # and for example a worker thread doesn't just exit on its own in response to |
@@ -1219,9 +1221,14 @@ class CookerParser(object): | |||
1219 | self.shutdown(clean=False) | 1221 | self.shutdown(clean=False) |
1220 | bb.fatal('Error parsing %s: %s' % | 1222 | bb.fatal('Error parsing %s: %s' % |
1221 | (exc.recipe, bb.exceptions.to_string(exc.realexception))) | 1223 | (exc.recipe, bb.exceptions.to_string(exc.realexception))) |
1222 | except Exception as exc: | 1224 | except Exception: |
1225 | import traceback | ||
1226 | etype, value, tb = sys.exc_info() | ||
1227 | formatted = bb.exceptions.format_extracted(value.traceback, limit=5) | ||
1228 | formatted.extend(traceback.format_exception_only(etype, value)) | ||
1229 | |||
1223 | self.shutdown(clean=False) | 1230 | self.shutdown(clean=False) |
1224 | bb.fatal('Error parsing %s: %s' % (exc.recipe, exc)) | 1231 | bb.fatal('Error parsing %s:\n%s' % (value.recipe, ''.join(formatted))) |
1225 | 1232 | ||
1226 | self.current += 1 | 1233 | self.current += 1 |
1227 | self.virtuals += len(result) | 1234 | self.virtuals += len(result) |