Skip to contentSkip to conversation

main: Ensure exceptions are correctly displayed

PATCH New Richard Purdie 1 participant 1 message May 12, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 main: Ensure exceptions are correctly displayed

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.

lib/bb/main.py +1 -2
index a287905..b296ef8 100755
@@ -336,7 +336,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"):
             import queue
             try:
@@ -345,7 +344,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