diff --git a/application/database/db.py b/application/database/db.py index 50528c22e..0572193bc 100644 --- a/application/database/db.py +++ b/application/database/db.py @@ -23,7 +23,7 @@ from flask_sqlalchemy.model import DefaultMeta from sqlalchemy import func, delete, cast as sql_cast, literal, or_ from sqlalchemy.dialects.postgresql import JSONB -from sqlalchemy.exc import OperationalError, IntegrityError +from sqlalchemy.exc import OperationalError, IntegrityError, SQLAlchemyError from neomodel import ( config, @@ -2289,7 +2289,7 @@ def health_check(self) -> Dict[str, Any]: "db_reachable": False, "reason": "database unreachable", } - except Exception: # pragma: no cover - defensive, never fail open + except SQLAlchemyError: # pragma: no cover - defensive, never fail open return { "ok": False, "db_reachable": False,