mirror of
https://git.yoctoproject.org/poky
synced 2026-05-02 09:32:14 +02:00
Shift exception formatting into the UI
Now we use bb.exceptions to pass pickleable traceback entries to the UI, and the UI is free to do whatever it wants to do with this information. By default, the log formatter for the UIs formats it with bb.exceptions. This also means that all exceptions should now show 3 lines of context and limit to 5 entries. (Bitbake rev: ee48d628ee038bd72e1cd94aa75f5ccbacbcee4c) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
a3efbb96f2
commit
96e2ee1d73
@@ -1225,7 +1225,7 @@ class CookerParser(object):
|
||||
raise
|
||||
except ParsingFailure as exc:
|
||||
self.shutdown(clean=False)
|
||||
bb.fatal('Error parsing %s: %s' %
|
||||
bb.fatal('Unable to parse %s: %s' %
|
||||
(exc.recipe, bb.exceptions.to_string(exc.realexception)))
|
||||
except bb.parse.ParseError as exc:
|
||||
bb.fatal(str(exc))
|
||||
@@ -1233,13 +1233,11 @@ class CookerParser(object):
|
||||
logger.error('Unable to parse %s', exc.recipe)
|
||||
sys.exit(1)
|
||||
except Exception as exc:
|
||||
import traceback
|
||||
etype, value, tb = sys.exc_info()
|
||||
formatted = bb.exceptions.format_extracted(value.traceback, limit=5)
|
||||
formatted.extend(traceback.format_exception_only(etype, value))
|
||||
|
||||
logger.error('Unable to parse %s', value.recipe,
|
||||
exc_info=(etype, value, exc.traceback))
|
||||
self.shutdown(clean=False)
|
||||
bb.fatal('Error parsing %s:\n%s' % (value.recipe, ''.join(formatted)))
|
||||
sys.exit(1)
|
||||
|
||||
self.current += 1
|
||||
self.virtuals += len(result)
|
||||
|
||||
Reference in New Issue
Block a user