From patchwork Wed May 30 16:17:16 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [bitbake-devel, 3/5] cooker: report recipe being parsed when ExpansionError occurs Date: Wed, 30 May 2012 16:17:16 -0000 From: Paul Eggleton X-Patchwork-Id: 28959 Message-Id: To: bitbake-devel@lists.openembedded.org When an ExpansionError occurs during parsing it is useful to know which recipe was being parsed when it occurred. Signed-off-by: Paul Eggleton --- bitbake/lib/bb/cooker.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index b30945c..928b600 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py @@ -1657,9 +1657,13 @@ class CookerParser(object): logger.error('Unable to parse %s: %s' % (exc.recipe, bb.exceptions.to_string(exc.realexception))) self.shutdown(clean=False) - except (bb.parse.ParseError, bb.data_smart.ExpansionError) as exc: + except bb.parse.ParseError as exc: logger.error(str(exc)) self.shutdown(clean=False) + except bb.data_smart.ExpansionError as exc: + _, value, _ = sys.exc_info() + logger.error('ExpansionError during parsing %s: %s', value.recipe, str(exc)) + self.shutdown(clean=False) except SyntaxError as exc: logger.error('Unable to parse %s', exc.recipe) self.shutdown(clean=False)