diff --git a/src/revChatGPT/V1.py b/src/revChatGPT/V1.py index 4be2b9caa4..4541425e9e 100644 --- a/src/revChatGPT/V1.py +++ b/src/revChatGPT/V1.py @@ -476,11 +476,13 @@ def post_messages( "Conversation ID %s not found in conversation mapping, try to get conversation history for the given ID", conversation_id, ) - with contextlib.suppress(Exception): + try: history = self.get_msg_history(conversation_id) self.conversation_mapping[conversation_id] = history[ "current_node" ] + except requests.exceptions.HTTPError: + print("Conversation unavailable") else: self.__map_conversations() if conversation_id in self.conversation_mapping: @@ -706,7 +708,7 @@ def get_msg_history(self, convo_id: str, encoding: str | None = None) -> list: self.__check_response(response) if encoding is not None: response.encoding = encoding - return json.loads(response.text) + return response.json() @logger(is_timed=True) def gen_title(self, convo_id: str, message_id: str) -> str: