Openembedded Bitbake Development
 help / color / mirror / Atom feed
* [PATCH 1/2] bb.cookerdata: don't show traceback for ParseError/ExpansionError
@ 2015-07-31 18:16 Christopher Larson
  2015-07-31 18:16 ` [PATCH 2/2] bb.parse: properly error out on filesystem errors Christopher Larson
  2015-07-31 18:17 ` [PATCH 1/2] bb.cookerdata: don't show traceback for ParseError/ExpansionError Christopher Larson
  0 siblings, 2 replies; 3+ messages in thread
From: Christopher Larson @ 2015-07-31 18:16 UTC (permalink / raw)
  To: bitbake-devel; +Cc: Christopher Larson

From: Christopher Larson <chris_larson@mentor.com>

Tracebacks are of extremely limited usefulness in this context. The exceptions
carry the necessary context already, and the user doesn't care about the calls
in bitbake internals that led to an expansion or parse failure.

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
---
 lib/bb/cookerdata.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lib/bb/cookerdata.py b/lib/bb/cookerdata.py
index 0ca87a0..57fc6bb 100644
--- a/lib/bb/cookerdata.py
+++ b/lib/bb/cookerdata.py
@@ -173,9 +173,12 @@ def catch_parse_error(func):
     def wrapped(fn, *args):
         try:
             return func(fn, *args)
-        except (IOError, bb.parse.ParseError, bb.data_smart.ExpansionError) as exc:
+        except IOError as exc:
             import traceback
-            parselog.critical( traceback.format_exc())
+            parselog.critical(traceback.format_exc())
+            parselog.critical("Unable to parse %s: %s" % (fn, exc))
+            sys.exit(1)
+        except (bb.parse.ParseError, bb.data_smart.ExpansionError) as exc:
             parselog.critical("Unable to parse %s: %s" % (fn, exc))
             sys.exit(1)
     return wrapped
-- 
2.2.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-07-31 18:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-31 18:16 [PATCH 1/2] bb.cookerdata: don't show traceback for ParseError/ExpansionError Christopher Larson
2015-07-31 18:16 ` [PATCH 2/2] bb.parse: properly error out on filesystem errors Christopher Larson
2015-07-31 18:17 ` [PATCH 1/2] bb.cookerdata: don't show traceback for ParseError/ExpansionError Christopher Larson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox