Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions redis/_parsers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
NoScriptError,
OutOfMemoryError,
ReadOnlyError,
RedisError,
ResponseError,
TryAgainError,
)
Expand Down Expand Up @@ -415,7 +414,7 @@ def on_connect(self, connection):
"""Called when the stream connects"""
self._stream = connection._reader
if self._stream is None:
raise RedisError("Buffer is closed.")
raise ConnectionError(SERVER_CLOSED_CONNECTION_ERROR)
self.encoder = connection.encoder
self._clear()
self._connected = True
Expand All @@ -426,7 +425,7 @@ def on_disconnect(self):

async def can_read_destructive(self) -> bool:
if not self._connected:
raise RedisError("Buffer is closed.")
raise OSError("Buffer is closed.")
if self._buffer:
return True
try:
Expand Down
2 changes: 1 addition & 1 deletion redis/_parsers/hiredis.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def on_disconnect(self):

async def can_read_destructive(self):
if not self._connected:
raise ConnectionError(SERVER_CLOSED_CONNECTION_ERROR)
raise OSError("Buffer is closed.")
if self._reader.gets() is not NOT_ENOUGH_DATA:
return True
try:
Expand Down