From 84b0e15e2b06a9dac2b7f8755e1f7ac896bc9ee1 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Thu, 10 Feb 2022 20:14:09 +0100 Subject: [PATCH] Revert "Make Connection.send() raise the actual exception" This reverts commit ed2db45a03dc9a2391fee8f40e9ff059c109c291. --- pyrogram/connection/connection.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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()