mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-09 16:14:52 +00:00
Raise OSError in case "send" fails
This commit is contained in:
parent
52354b93d0
commit
5d58ff2d94
1 changed files with 4 additions and 1 deletions
|
|
@ -64,7 +64,10 @@ class Connection:
|
||||||
log.info("Disconnected")
|
log.info("Disconnected")
|
||||||
|
|
||||||
async def send(self, data: bytes):
|
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:
|
async def recv(self) -> bytes or None:
|
||||||
return await self.protocol.recv()
|
return await self.protocol.recv()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue