Skip to content

Commit

Permalink
Revert "Revert "Raise OperationalError for socket timeouts""
Browse files Browse the repository at this point in the history
This reverts commit 53a1dad.
  • Loading branch information
jiezhen-chen committed Aug 4, 2023
1 parent 53a1dad commit 546588c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion redshift_connector/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,10 @@ def get_calling_module() -> str:
self._usock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)
except socket.error as e:
self._usock.close()
raise InterfaceError("communication error", e)
if socket.timeout:
raise OperationalError("connection time out", e)
else:
raise InterfaceError("communication error", e)
self._flush: typing.Callable = self._sock.flush
self._read: typing.Callable = self._sock.read
self._write: typing.Callable = self._sock.write
Expand Down

0 comments on commit 546588c

Please sign in to comment.