diff --git a/pytchat/core_async/livechat.py b/pytchat/core_async/livechat.py index 2cc3ff8..fac41ad 100644 --- a/pytchat/core_async/livechat.py +++ b/pytchat/core_async/livechat.py @@ -333,12 +333,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 7f99c55..f4a2513 100644 --- a/pytchat/core_multithread/livechat.py +++ b/pytchat/core_multithread/livechat.py @@ -324,12 +324,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):