]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
main: Ensure exceptions are correctly displayed
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 12 May 2016 07:15:34 +0000 (08:15 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 12 May 2016 22:01:03 +0000 (23:01 +0100)
If the cooker fails to start, ensure a correct exception is displayed to the
user. After handling any queued events simply re-raise the original exception
else the output can be unclear.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/bb/main.py

index eb15779facc1f5ddb169d603da71616ecd5d53b5..761ea459cf1ff359015553ce0c3e1a33c27b6a68 100755 (executable)
@@ -335,7 +335,6 @@ def start_server(servermodule, configParams, configuration, features):
         server.addcooker(cooker)
         server.saveConnectionDetails()
     except Exception as e:
-        exc_info = sys.exc_info()
         while hasattr(server, "event_queue"):
             try:
                 import queue
@@ -347,7 +346,7 @@ def start_server(servermodule, configParams, configuration, features):
                 break
             if isinstance(event, logging.LogRecord):
                 logger.handle(event)
-        raise exc_info[1], None, exc_info[2]
+        raise
     server.detach()
     cooker.lock.close()
     return server