diff --git a/reflex/model.py b/reflex/model.py index acfa8779882..c75f17b97da 100644 --- a/reflex/model.py +++ b/reflex/model.py @@ -316,7 +316,7 @@ def get_db_status() -> dict[str, bool]: engine = get_engine() with engine.connect() as connection: connection.execute(sqlalchemy.text("SELECT 1")) - except sqlalchemy.exc.OperationalError: + except Exception: status = False return {"db": status} diff --git a/reflex/utils/prerequisites.py b/reflex/utils/prerequisites.py index 886d1dead96..f591a5479dd 100644 --- a/reflex/utils/prerequisites.py +++ b/reflex/utils/prerequisites.py @@ -431,8 +431,6 @@ async def get_redis_status() -> dict[str, bool | None]: Returns: The status of the Redis connection. """ - from redis.exceptions import RedisError - try: status = True redis_client = get_redis() @@ -442,7 +440,7 @@ async def get_redis_status() -> dict[str, bool | None]: await ping_command else: status = None - except RedisError: + except Exception: status = False return {"redis": status}