diff --git a/pytchat/core_async/livechat.py b/pytchat/core_async/livechat.py index 17f91f2..ed11922 100644 --- a/pytchat/core_async/livechat.py +++ b/pytchat/core_async/livechat.py @@ -334,12 +334,12 @@ class LiveChatAsync: ''' if self.is_alive(): self.terminate() - try: - self.listen_task.result() - except Exception as e: - self.exception = e - if not isinstance(e, exceptions.ChatParseException): - self._logger.error(f'Internal exception - {type(e)}{str(e)}') + try: + self.listen_task.result() + except Exception as e: + self.exception = e + if not isinstance(e, exceptions.ChatParseException): + self._logger.error(f'Internal exception - {type(e)}{str(e)}') self._logger.info(f'[{self._video_id}]終了しました') def raise_for_status(self): diff --git a/pytchat/core_multithread/livechat.py b/pytchat/core_multithread/livechat.py index f439026..d05ca3d 100644 --- a/pytchat/core_multithread/livechat.py +++ b/pytchat/core_multithread/livechat.py @@ -325,12 +325,12 @@ class LiveChat: ''' if self.is_alive(): self.terminate() - try: - self.listen_task.result() - except Exception as e: - self.exception = e - if not isinstance(e, exceptions.ChatParseException): - self._logger.error(f'Internal exception - {type(e)}{str(e)}') + try: + self.listen_task.result() + except Exception as e: + self.exception = e + if not isinstance(e, exceptions.ChatParseException): + self._logger.error(f'Internal exception - {type(e)}{str(e)}') self._logger.info(f'[{self._video_id}]終了しました') def raise_for_status(self):