Skip to content
This repository has been archived by the owner on Feb 21, 2023. It is now read-only.

fix socket.error raises #1129

Merged
merged 16 commits into from Nov 29, 2021
1 change: 1 addition & 0 deletions CHANGES/1129.bugfix
@@ -0,0 +1 @@
fixed raw socket.error(or one of its subclasses) raises instead of a redis.exceptions.ConnectionError
x0day marked this conversation as resolved.
Show resolved Hide resolved
5 changes: 5 additions & 0 deletions aioredis/connection.py
Expand Up @@ -858,6 +858,11 @@ async def read_response(self):
except asyncio.TimeoutError:
await self.disconnect()
raise TimeoutError(f"Timeout reading from {self.host}:{self.port}")
except OSError as e:
x0day marked this conversation as resolved.
Show resolved Hide resolved
await self.disconnect()
raise ConnectionError(
f"Error while reading from {self.host}:{self.port} : {e.args}"
)
except BaseException:
await self.disconnect()
raise
Expand Down