Skip to content

Commit a9997b0

Browse files
fix: Psl bug 9334 (#1425)
1 parent 2b33990 commit a9997b0

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

code/backend/api/chat_history.py

+14-14
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ async def list_conversations():
100100
return (jsonify(conversations), 200)
101101

102102
except Exception as e:
103-
logger.exception("Exception in /list")
104-
return (jsonify({"error": str(e)}), 500)
103+
logger.exception("Exception in /list" + str(e))
104+
return (jsonify({"error": "Error While listing historical conversations"}), 500)
105105

106106

107107
@bp_chat_history_response.route("/history/rename", methods=["POST"])
@@ -152,8 +152,8 @@ async def rename_conversation():
152152
return (jsonify(updated_conversation), 200)
153153

154154
except Exception as e:
155-
logger.exception("Exception in /rename")
156-
return (jsonify({"error": str(e)}), 500)
155+
logger.exception("Exception in /rename" + str(e))
156+
return (jsonify({"error": "Error renaming is fail"}), 500)
157157

158158

159159
@bp_chat_history_response.route("/history/read", methods=["POST"])
@@ -217,8 +217,8 @@ async def get_conversation():
217217
200,
218218
)
219219
except Exception as e:
220-
logger.exception("Exception in /read")
221-
return (jsonify({"error": str(e)}), 500)
220+
logger.exception("Exception in /read" + str(e))
221+
return (jsonify({"error": "Error while fetching history conversation"}), 500)
222222

223223

224224
@bp_chat_history_response.route("/history/delete", methods=["DELETE"])
@@ -266,8 +266,8 @@ async def delete_conversation():
266266
200,
267267
)
268268
except Exception as e:
269-
logger.exception("Exception in /delete")
270-
return (jsonify({"error": str(e)}), 500)
269+
logger.exception("Exception in /delete" + str(e))
270+
return (jsonify({"error": "Error while deleting history conversation"}), 500)
271271

272272

273273
@bp_chat_history_response.route("/history/delete_all", methods=["DELETE"])
@@ -320,8 +320,8 @@ async def delete_all_conversations():
320320
)
321321

322322
except Exception as e:
323-
logger.exception("Exception in /delete")
324-
return (jsonify({"error": str(e)}), 500)
323+
logger.exception("Exception in /delete" + str(e))
324+
return (jsonify({"error": "Error while deleting all history conversation"}), 500)
325325

326326

327327
@bp_chat_history_response.route("/history/update", methods=["POST"])
@@ -412,8 +412,8 @@ async def update_conversation():
412412
)
413413

414414
except Exception as e:
415-
logger.exception("Exception in /update")
416-
return (jsonify({"error": str(e)}), 500)
415+
logger.exception("Exception in /update" + str(e))
416+
return (jsonify({"error": "Error while update the history conversation"}), 500)
417417

418418

419419
@bp_chat_history_response.route("/history/frontend_settings", methods=["GET"])
@@ -428,8 +428,8 @@ def get_frontend_settings():
428428
)
429429
return jsonify({"CHAT_HISTORY_ENABLED": chat_history_enabled}), 200
430430
except Exception as e:
431-
logger.exception("Exception in /frontend_settings")
432-
return (jsonify({"error": str(e)}), 500)
431+
logger.exception("Exception in /frontend_settings" + str(e))
432+
return (jsonify({"error": "Error while getting frontend settings"}), 500)
433433

434434

435435
async def generate_title(conversation_messages):

0 commit comments

Comments
 (0)