mirror of
https://github.com/pyrogram/pyrogram
synced 2025-09-05 08:45:13 +00:00
Raise OSError in case "send" fails
This commit is contained in:
@@ -64,7 +64,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) -> bytes or None:
|
||||
return await self.protocol.recv()
|
||||
|
Reference in New Issue
Block a user