Raise OSError in case "send" fails

This commit is contained in:
Dan 2018-06-17 18:45:08 +02:00
parent 52354b93d0
commit 5d58ff2d94

View File

@ -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()