Skip to content

Commit

Permalink
Fix code scanning alert no. 24: Information exposure through an excep…
Browse files Browse the repository at this point in the history
…tion

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
  • Loading branch information
1 parent 00027f8 commit f6456ee
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions End_to_end_Solutions/AOAISearchDemo/app/backend/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ def chat():
return jsonify(response.to_item()), 400
except Exception as e:
logger.exception(f"Exception in /chat: {e}", extra=properties)
response = ChatResponse(answer=Answer(), error=str(e), show_retry=True)
response = ChatResponse(answer=Answer(), error="An internal error has occurred.", show_retry=True)
return jsonify(response.to_item()), 500


Expand All @@ -352,7 +352,7 @@ def get_all_user_profiles():
return jsonify(user_profiles_dict)
except Exception as e:
logger.exception(f"Exception in /user-profiles: {e}")
return jsonify({"error": "An internal error has occurred!"}), 500
return jsonify({"error": "An internal error has occurred."}), 500


@app.route("/chat-sessions/<user_id>/<conversation_id>", methods=["DELETE"])
Expand All @@ -369,7 +369,7 @@ def clear_chat_session(user_id: str, conversation_id: str):
logger.exception(
f"Exception in /chat-sessions/<user_id>/<conversation_id>: {e}"
)
return jsonify({"error": "An internal error has occurred!"}), 500
return jsonify({"error": "An internal error has occurred."}), 500


@app.route("/search-settings", methods=["GET"])
Expand All @@ -391,7 +391,7 @@ def get_search_settings():
return jsonify(search_settings.to_item())
except Exception as e:
logger.exception(f"Exception in /search-settings: {e}")
return jsonify({"error": "An internal error has occurred!"}), 500
return jsonify({"error": "An internal error has occurred."}), 500


if __name__ == "__main__":
Expand Down

0 comments on commit f6456ee

Please sign in to comment.