diff --git a/neo4j/_async/io/_common.py b/neo4j/_async/io/_common.py index 8f510689a..2f7c18266 100644 --- a/neo4j/_async/io/_common.py +++ b/neo4j/_async/io/_common.py @@ -139,7 +139,9 @@ async def flush(self): if data: try: await self.socket.sendall(data) - except (OSError, asyncio.CancelledError) as error: + except ( + OSError, SocketDeadlineExceeded, asyncio.CancelledError + ) as error: await AsyncUtil.callback(self.on_error, error) return False self._clear() diff --git a/neo4j/_sync/io/_common.py b/neo4j/_sync/io/_common.py index 3aa2f24d9..04312bfe4 100644 --- a/neo4j/_sync/io/_common.py +++ b/neo4j/_sync/io/_common.py @@ -139,7 +139,9 @@ def flush(self): if data: try: self.socket.sendall(data) - except (OSError, asyncio.CancelledError) as error: + except ( + OSError, SocketDeadlineExceeded, asyncio.CancelledError + ) as error: Util.callback(self.on_error, error) return False self._clear()