@@ -222,13 +222,18 @@ async def update_runners(ws_context: context.WorkspaceContext) -> None:
222222 runner .working_dir_path : runner for runner in extension_runners
223223 }
224224
225- init_runners_coros = [
226- _init_runner (
227- runner , ws_context .ws_projects [runner .working_dir_path ], ws_context
228- )
229- for runner in extension_runners
230- ]
231- await asyncio .gather (* init_runners_coros )
225+ try :
226+ async with asyncio .TaskGroup () as tg :
227+ for runner in extension_runners :
228+ tg .create_task (
229+ _init_runner (
230+ runner , ws_context .ws_projects [runner .working_dir_path ], ws_context
231+ )
232+ )
233+ except ExceptionGroup as eg :
234+ for exception in eg .exceptions :
235+ logger .exception (exception )
236+ raise RunnerFailedToStart ("Failed to initialize runner" )
232237
233238
234239async def _init_runner (
@@ -250,7 +255,7 @@ async def _init_runner(
250255 project .status = domain .ProjectStatus .RUNNER_FAILED
251256 await notify_project_changed (project )
252257 runner .initialized_event .set ()
253- return
258+ raise RunnerFailedToStart ( f"Runner failed to initialize: { error } " )
254259
255260 try :
256261 await runner_client .notify_initialized (runner )
@@ -260,7 +265,8 @@ async def _init_runner(
260265 await notify_project_changed (project )
261266 runner .initialized_event .set ()
262267 logger .exception (error )
263- return
268+ raise RunnerFailedToStart (f"Runner failed to notify about initialization: { error } " )
269+
264270 logger .debug ("LSP Server initialized" )
265271
266272 await read_configs .read_project_config (project = project , ws_context = ws_context )
@@ -278,7 +284,7 @@ async def _init_runner(
278284 project .status = domain .ProjectStatus .RUNNER_FAILED
279285 await notify_project_changed (project )
280286 runner .initialized_event .set ()
281- return
287+ raise RunnerFailedToStart ( f"Runner failed to update config: { error } " )
282288
283289 logger .debug (
284290 f"Updated config of runner { runner .working_dir_path } ,"
0 commit comments