diff --git a/pyrogram/connection/connection.py b/pyrogram/connection/connection.py index e90ff9c4..2173c70b 100644 --- a/pyrogram/connection/connection.py +++ b/pyrogram/connection/connection.py @@ -77,7 +77,10 @@ class Connection: log.info("Disconnected") async def send(self, data: bytes): - await self.protocol.send(data) + try: + await self.protocol.send(data) + except Exception: + raise OSError async def recv(self) -> Optional[bytes]: return await self.protocol.recv()