aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bb/cooker.py
diff options
context:
space:
mode:
authorMingli Yu <mingli.yu@windriver.com>2023-04-12 15:32:42 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-04-13 12:00:11 +0100
commit316524ab59a5e738c25e062923ee5717d88ae5c7 (patch)
treeab07faa130a7bf4c8458032a0f9851f5a60453f3 /lib/bb/cooker.py
parentae2efb05196f9e29ef56ad9a84e2eae5fbdd8030 (diff)
downloadbitbake-316524ab59a5e738c25e062923ee5717d88ae5c7.tar.gz
event: add bb.event.ParseError
Add bb.event.ParseError to let error-report can catch this kind of error. Signed-off-by: Mingli Yu <mingli.yu@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/cooker.py')
-rw-r--r--lib/bb/cooker.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py
index 1797a1d4c..c8ff3ce08 100644
--- a/lib/bb/cooker.py
+++ b/lib/bb/cooker.py
@@ -2223,7 +2223,7 @@ class CookerParser(object):
self.results = itertools.chain(self.results, self.parse_generator())
- def shutdown(self, clean=True):
+ def shutdown(self, clean=True, eventmsg="Parsing halted due to errors"):
if not self.toparse:
return
if self.haveshutdown:
@@ -2238,6 +2238,7 @@ class CookerParser(object):
bb.event.fire(event, self.cfgdata)
else:
+ bb.event.fire(bb.event.ParseError(eventmsg), self.cfgdata)
bb.error("Parsing halted due to errors, see error messages above")
# Cleanup the queue before call process.join(), otherwise there might be
@@ -2355,7 +2356,7 @@ class CookerParser(object):
except bb.parse.ParseError as exc:
self.error += 1
logger.error(str(exc))
- self.shutdown(clean=False)
+ self.shutdown(clean=False, eventmsg=str(exc))
return False
except bb.data_smart.ExpansionError as exc:
self.error += 1