From ab2d72172305f756b5750eff7fd05e684f705913 Mon Sep 17 00:00:00 2001 From: Leo Vasanko Date: Sun, 13 Sep 2026 05:25:25 +0000 Subject: [PATCH] Devutil ready() now logs and raises RuntimeError on timeout. --- template/scripts/fastapi-vue/devutil.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/template/scripts/fastapi-vue/devutil.py b/template/scripts/fastapi-vue/devutil.py index deda46c..a01497f 100644 --- a/template/scripts/fastapi-vue/devutil.py +++ b/template/scripts/fastapi-vue/devutil.py @@ -126,7 +126,7 @@ async def ready(url: str, path: str = "", max_attempts: int = 50) -> None: """Wait for the server to be ready by polling an endpoint. Use empty path to disable the check and make this return immediately. - Raises TimeoutError if server doesn't start in time. + Logs, then raises RuntimeError if the server doesn't start in time. """ if not path: return @@ -136,7 +136,8 @@ async def ready(url: str, path: str = "", max_attempts: int = 50) -> None: logger.info("✓ Backend ready!") return if attempt == max_attempts - 1: - raise TimeoutError(f"Backend at {url} didn't start in time") # noqa: EM102, TRY003 + logger.error("Backend at %s didn't start in time", url) + raise RuntimeError(url) await asyncio.sleep(0.1)