All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: bitbake-devel <bitbake-devel@lists.openembedded.org>
Subject: [PATCH] utils.py: Once we've printed errors messages, suppress the backtrace
Date: Wed, 22 Aug 2012 20:02:39 +0100	[thread overview]
Message-ID: <1345662159.3907.129.camel@ted> (raw)

Adding a generic backtrace to better_compile and better_exec is pointless,
therefore reraise the exception as a bb.BBHandledException so the
generic code doesn't confuse the user even more.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py
index e0ef63c..82dab6b 100644
--- a/bitbake/lib/bb/utils.py
+++ b/bitbake/lib/bb/utils.py
@@ -216,7 +216,8 @@ def better_compile(text, file, realfile, mode = "exec"):
             for line in body:
                 logger.error(line)
 
-        raise
+        e = bb.BBHandledException(e)
+        raise e
 
 def better_exec(code, context, text = None, realfile = "<code>"):
     """
@@ -231,7 +232,7 @@ def better_exec(code, context, text = None, realfile = "<code>"):
         code = better_compile(code, realfile, realfile)
     try:
         exec(code, _context, context)
-    except Exception:
+    except Exception as e:
         (t, value, tb) = sys.exc_info()
 
         if t in [bb.parse.SkipPackage, bb.build.FuncFailed]:
@@ -280,7 +281,8 @@ def better_exec(code, context, text = None, realfile = "<code>"):
             nexttb = tb.tb_next
             level = level + 1
 
-        raise
+        e = bb.BBHandledException(e)
+        raise e
 
 def simple_exec(code, context):
     exec(code, _context, context)





                 reply	other threads:[~2012-08-22 19:14 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1345662159.3907.129.camel@ted \
    --to=richard.purdie@linuxfoundation.org \
    --cc=bitbake-devel@lists.openembedded.org \
    /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.