修复无法取消协程的问题

This commit is contained in:
John Smith 2019-06-20 23:23:59 +08:00
parent 2f705b86ce
commit 0d63944da4

View File

@ -407,7 +407,12 @@ class BLiveClient:
if message.type == aiohttp.WSMsgType.BINARY:
try:
await self._handle_message(message.data)
except:
except BaseException as e:
if type(e) in (
asyncio.CancelledError, aiohttp.ClientConnectorError,
asyncio.TimeoutError, ssl_.SSLError
):
raise
logger.exception('room %d 处理消息时发生错误:', self.room_id)
else:
logger.warning('room %d 未知的websocket消息type=%s %s', self.room_id,