Skip to content

Commit 47876ab

Browse files
authored
Fix #733 Better error handling when getting TimeoutError in RTMClient#start() (#752)
1 parent 93a4731 commit 47876ab

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

slack/rtm/client.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,10 @@ async def _read_messages(self):
401401
# True
402402
message = await self._websocket.receive(timeout=1)
403403
except asyncio.TimeoutError:
404+
if self._websocket is None:
405+
# For some reason, the connection unexpectedly doesn't exist here.
406+
# In the case, this method can do nothing.
407+
return
404408
if not self._websocket.closed:
405409
# We didn't receive a message within the timeout interval, but
406410
# aiohttp hasn't closed the socket, so ping responses must still be

0 commit comments

Comments
 (0)