Skip to content

Commit 50a9cd7

Browse files
authored
redis.ConnectionError should be caught (#30)
1 parent bc90bb0 commit 50a9cd7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/fastapi_redis_cache/redis.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ def _connect(host_url: str) -> Tuple[RedisStatus, redis.client.Redis]: # pragma
2020
return (RedisStatus.CONN_ERROR, None)
2121
except redis.AuthenticationError:
2222
return (RedisStatus.AUTH_ERROR, None)
23+
except redis.ConnectionError:
24+
return (RedisStatus.CONN_ERROR, None)
2325

2426

2527
def _connect_fake() -> Tuple[RedisStatus, redis.client.Redis]:

0 commit comments

Comments
 (0)