main: Ensure exceptions are correctly displayed
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.
Signed-off-by Richard Purdie <[email protected]>
lib/bb/main.py +1 -2
@@ -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