Skip to content

Commit

Permalink
Merge pull request #43 from arpitjain099/alert-autofix-24
Browse files Browse the repository at this point in the history
Fix code scanning alert no. 24: Information exposure through an exception
  • Loading branch information
arpitjain099 authored Oct 20, 2024
2 parents 00027f8 + f6456ee commit bc8c79f
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 bc8c79f

Please sign in to comment.