From df67a2edc89cc6d585e9c4144addd997ebbf2718 Mon Sep 17 00:00:00 2001 From: Arpit Jain <3242828+arpitjain099@users.noreply.github.com> Date: Sun, 20 Oct 2024 13:54:30 +0900 Subject: [PATCH] Fix code scanning alert no. 64: 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 d1d8ada..fa8eb3f 100644 --- a/End_to_end_Solutions/AOAISearchDemo/app/data/app.py +++ b/End_to_end_Solutions/AOAISearchDemo/app/data/app.py @@ -279,7 +279,8 @@ def update_user_group(group_id: str): except (TypeError, NullValueError, MissingPropertyError, ValueError) as e: return Response(response=str(e), status=400) except SessionNotFoundError as e: - return Response(response=str(e), status=404) + logging.error("Session not found: %s", e, exc_info=True) + return Response(response="Session not found.", status=404) except Exception as e: logging.error("An error occurred while updating user group: %s", e, exc_info=True) return Response(response="An internal error has occurred.", status=500)