diff options
| -rw-r--r-- | bitbake/lib/bb/cooker.py | 12 |
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 | ||
| 951 | class 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 | |||
| 951 | def parse_file(task): | 958 | def 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 | ||
| 959 | class CookerParser(object): | 971 | class CookerParser(object): |
| 960 | def __init__(self, cooker, filelist, masked): | 972 | def __init__(self, cooker, filelist, masked): |
