diff --git a/code/backend/api/chat_history.py b/code/backend/api/chat_history.py index e43616e95..a0a67f82d 100644 --- a/code/backend/api/chat_history.py +++ b/code/backend/api/chat_history.py @@ -100,8 +100,8 @@ async def list_conversations(): return (jsonify(conversations), 200) except Exception as e: - logger.exception("Exception in /list") - return (jsonify({"error": str(e)}), 500) + logger.exception("Exception in /list" + str(e)) + return (jsonify({"error": "Error While listing historical conversations"}), 500) @bp_chat_history_response.route("/history/rename", methods=["POST"]) @@ -152,8 +152,8 @@ async def rename_conversation(): return (jsonify(updated_conversation), 200) except Exception as e: - logger.exception("Exception in /rename") - return (jsonify({"error": str(e)}), 500) + logger.exception("Exception in /rename" + str(e)) + return (jsonify({"error": "Error renaming is fail"}), 500) @bp_chat_history_response.route("/history/read", methods=["POST"]) @@ -217,8 +217,8 @@ async def get_conversation(): 200, ) except Exception as e: - logger.exception("Exception in /read") - return (jsonify({"error": str(e)}), 500) + logger.exception("Exception in /read" + str(e)) + return (jsonify({"error": "Error while fetching history conversation"}), 500) @bp_chat_history_response.route("/history/delete", methods=["DELETE"]) @@ -266,8 +266,8 @@ async def delete_conversation(): 200, ) except Exception as e: - logger.exception("Exception in /delete") - return (jsonify({"error": str(e)}), 500) + logger.exception("Exception in /delete" + str(e)) + return (jsonify({"error": "Error while deleting history conversation"}), 500) @bp_chat_history_response.route("/history/delete_all", methods=["DELETE"]) @@ -320,8 +320,8 @@ async def delete_all_conversations(): ) except Exception as e: - logger.exception("Exception in /delete") - return (jsonify({"error": str(e)}), 500) + logger.exception("Exception in /delete" + str(e)) + return (jsonify({"error": "Error while deleting all history conversation"}), 500) @bp_chat_history_response.route("/history/update", methods=["POST"]) @@ -412,8 +412,8 @@ async def update_conversation(): ) except Exception as e: - logger.exception("Exception in /update") - return (jsonify({"error": str(e)}), 500) + logger.exception("Exception in /update" + str(e)) + return (jsonify({"error": "Error while update the history conversation"}), 500) @bp_chat_history_response.route("/history/frontend_settings", methods=["GET"]) @@ -428,8 +428,8 @@ def get_frontend_settings(): ) return jsonify({"CHAT_HISTORY_ENABLED": chat_history_enabled}), 200 except Exception as e: - logger.exception("Exception in /frontend_settings") - return (jsonify({"error": str(e)}), 500) + logger.exception("Exception in /frontend_settings" + str(e)) + return (jsonify({"error": "Error while getting frontend settings"}), 500) async def generate_title(conversation_messages):