From 0d63944da4558981cd55c1fdbfb11b97837780ff Mon Sep 17 00:00:00 2001 From: John Smith <xfgryujk@126.com> Date: Thu, 20 Jun 2019 23:23:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=97=A0=E6=B3=95=E5=8F=96?= =?UTF-8?q?=E6=B6=88=E5=8D=8F=E7=A8=8B=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- blivedm.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/blivedm.py b/blivedm.py index 83a2c69..5fa5d3c 100644 --- a/blivedm.py +++ b/blivedm.py @@ -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,