Commit Graph

6 Commits

Author SHA1 Message Date
Richard Purdie e6d9af19d6 bitbake/exceptions: Handle reports from the field of exception code failures
Despite using python 2.6, there have been reports of issues where
bitbake is printing tracebacks with errors in the exception handling
code. This was masking the real error.

Since we need to do whatever we can to give the user good feedback about
errors, detect the tuple instead of namedtuple case and don't fault
in the exception handler but just give up trying to traceback any further.

In the reported cases, this gives a message the user can then understand.

(Bitbake rev: 9ec0429271e68527a55fc123dea5a1b959c6ec3b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-25 11:15:12 +01:00
Chris Larson 0f74a38ffd bb.exceptions: don't choke on frames without arguments
(Bitbake rev: c9bb37e588ee7ee95eca798b0eae57bad68e8caf)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-08 20:38:25 +01:00
Chris Larson 2cf67a71e3 bb.exceptions: don't show a repr of 'self'
Rather than treating self like an ordinary argument, showing a repr of its
value in the function spec when formatting the traceback entry, now we show
the class name for the method as a part of the function name. Example:

Old: bar(self=<some repr of Fooclass>, f=5)
New: Fooclass.bar(f=5)

(Bitbake rev: dbf405f1f7fda41944093906c13044c6cf78f859)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-08 20:38:24 +01:00
Chris Larson 63d14f474d bb.exceptions: handle tb entries without context
(Bitbake rev: b010c4d37cfff5f74747d7da8cc1bf6719e29357)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-08 20:38:24 +01:00
Chris Larson 5b4b6bc7f7 bb.exceptions: add to_string convenience function
(Bitbake rev: 17a64df7e91438ee3fe1f7095c319f700a5372f1)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-08 20:38:23 +01:00
Chris Larson 22522d5f0d bb.exceptions: add code to create pickleable traceback entries
This lets you get as much useful information as possible from traceback
entries while staying pickleable.

In addition, it has improved traceback formatting.  It shows the values of the
arguments for the functions, lines of context from the file for the code, and
has an optional formatter to do things like syntax highlighting for the code
lines.

(Bitbake rev: ad8ad3fcae29eafbdc09286984495d693a4b73ef)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-06-08 20:38:23 +01:00