From 8d2020818d4d63ce2080a0e848ecc66942fdf087 Mon Sep 17 00:00:00 2001 From: florian Date: Fri, 10 Oct 2025 12:00:48 +0200 Subject: [PATCH] Forgot properly invoking the exception --- src/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.py b/src/main.py index 04aeba4..fb69bcb 100644 --- a/src/main.py +++ b/src/main.py @@ -67,13 +67,13 @@ async def prometheus_middleware(request: Request, call_next): return response @api.get("/health", tags=["Health"]) -async def return_health(db=Depends(get_db)): +def return_health(db=Depends(get_db)): try: cursor = db.cursor() cursor.execute("SELECT 1") cursor.fetchone() db_status = "ok" - except Exception: + except Exception as e: logger.error(f"Health check DB failed: {e}") db_status = "error"