From a45d967f568e014fd6c707c06929d83c04b02290 Mon Sep 17 00:00:00 2001 From: Arpit Jain <3242828+arpitjain099@users.noreply.github.com> Date: Sun, 20 Oct 2024 13:40:01 +0900 Subject: [PATCH] Fix code scanning alert no. 63: Information exposure through an exception Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- End_to_end_Solutions/AOAISearchDemo/app/data/app.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/End_to_end_Solutions/AOAISearchDemo/app/data/app.py b/End_to_end_Solutions/AOAISearchDemo/app/data/app.py index 99ddb05..457bf6f 100644 --- a/End_to_end_Solutions/AOAISearchDemo/app/data/app.py +++ b/End_to_end_Solutions/AOAISearchDemo/app/data/app.py @@ -361,7 +361,8 @@ def create_access_rule(rule_id: str): logging.error(f"Validation error in create_access_rule: {e}", exc_info=True) return Response(response="Invalid input provided.", status=400) except CosmosConflictError as e: - return Response(response=str(e), status=409) + logging.error(f"Cosmos conflict error in create_access_rule: {e}", exc_info=True) + return Response(response="A conflict occurred while processing your request.", status=409) except Exception as e: logging.error(f"Error in create_access_rule: {e}", exc_info=True) return Response(response="An internal error has occurred.", status=500)