All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christopher Larson <kergoth@gmail.com>
To: bitbake-devel@lists.openembedded.org
Cc: Christopher Larson <chris_larson@mentor.com>
Subject: [PATCH 1/2] bb.cookerdata: don't show traceback for ParseError/ExpansionError
Date: Fri, 31 Jul 2015 11:16:45 -0700	[thread overview]
Message-ID: <1438366606-23283-1-git-send-email-kergoth@gmail.com> (raw)

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



             reply	other threads:[~2015-07-31 18:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-31 18:16 Christopher Larson [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1438366606-23283-1-git-send-email-kergoth@gmail.com \
    --to=kergoth@gmail.com \
    --cc=bitbake-devel@lists.openembedded.org \
    --cc=chris_larson@mentor.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.