From e40c6cf55a375e1ad8bf6f08368b1b107be788e0 Mon Sep 17 00:00:00 2001 From: Arpit Jain <3242828+arpitjain099@users.noreply.github.com> Date: Sun, 20 Oct 2024 13:35:13 +0900 Subject: [PATCH] Fix code scanning alert no. 56: 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 98fcf9b..99ddb05 100644 --- a/End_to_end_Solutions/AOAISearchDemo/app/data/app.py +++ b/End_to_end_Solutions/AOAISearchDemo/app/data/app.py @@ -358,7 +358,8 @@ def create_access_rule(rule_id: str): access_rule = permissions_manager.create_access_rule(rule_id, resources, members) return Response(response=json.dumps(access_rule.to_item()), status=201) except (TypeError, NullValueError, MissingPropertyError) as e: - return Response(response=str(e), status=400) + 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) except Exception as e: