Add a TimeoutError if VoiceClient.connect fails.

This commit is contained in:
Rapptz
2016-05-06 13:30:44 -04:00
parent 570ccbf753
commit 701720a0f8
2 changed files with 11 additions and 2 deletions

View File

@ -553,7 +553,7 @@ class DiscordVoiceWebSocket(websockets.client.WebSocketClientProtocol):
@asyncio.coroutine
def poll_event(self):
try:
msg = yield from self.recv()
msg = yield from asyncio.wait_for(self.recv(), timeout=30.0, loop=self.loop)
yield from self.received_message(json.loads(msg))
except websockets.exceptions.ConnectionClosed as e:
raise ConnectionClosed(e) from e