From ed2db45a03dc9a2391fee8f40e9ff059c109c291 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Thu, 10 Feb 2022 06:45:59 +0100 Subject: [PATCH] Make Connection.send() raise the actual exception --- pyrogram/connection/connection.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pyrogram/connection/connection.py b/pyrogram/connection/connection.py index 2173c70b..e90ff9c4 100644 --- a/pyrogram/connection/connection.py +++ b/pyrogram/connection/connection.py @@ -77,10 +77,7 @@ class Connection: log.info("Disconnected") async def send(self, data: bytes): - try: - await self.protocol.send(data) - except Exception: - raise OSError + await self.protocol.send(data) async def recv(self) -> Optional[bytes]: return await self.protocol.recv()