[bitbake-devel] bin/bitbake: Improve exception handling

Submitted by Richard Purdie on May 20, 2013, 10 p.m.

Details

Message ID 1369087210.11013.0.camel@ted
State New
Headers show

Commit Message

Richard Purdie May 20, 2013, 10 p.m.
Due to the internal event processing, this excepting handler usually raises an
Empty error, masking the underlying failure. Ensure the original exception is
raised.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---

Patch hide | download patch | download mbox

diff --git a/bitbake/bin/bitbake b/bitbake/bin/bitbake
index 519ecd9..7087d2d 100755
--- a/bitbake/bin/bitbake
+++ b/bitbake/bin/bitbake
@@ -242,7 +242,8 @@  def main():
 
         server.addcooker(cooker)
         server.saveConnectionDetails()
-    except:
+    except Exception as e:
+        exc_info = sys.exc_info()
         while True:
             try:
                 import queue
@@ -254,7 +255,7 @@  def main():
                 break
             if isinstance(event, logging.LogRecord):
                 logger.handle(event)
-        raise
+        raise exc_info[1], None, exc_info[2]
     server.detach()
 
     # Should no longer need to ever reference cooker