diff --git a/redis/asyncio/connection.py b/redis/asyncio/connection.py index b819836af6..c5764f7343 100644 --- a/redis/asyncio/connection.py +++ b/redis/asyncio/connection.py @@ -57,6 +57,7 @@ AuthenticationWrongNumberOfArgsError, ConnectionError, DataError, + MaxConnectionsError, RedisError, ResponseError, TimeoutError, @@ -1208,7 +1209,7 @@ def get_available_connection(self): connection = self._available_connections.pop() except IndexError: if len(self._in_use_connections) >= self.max_connections: - raise ConnectionError("Too many connections") from None + raise MaxConnectionsError("Too many connections") from None connection = self.make_connection() self._in_use_connections.add(connection) return connection