Skip to content

Commit 409e515

Browse files
Fix code scanning alert no. 67: Information exposure through an exception
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent bc8c79f commit 409e515

File tree

1 file changed

+2
-1
lines changed
  • End_to_end_Solutions/AOAISearchDemo/app/data

1 file changed

+2
-1
lines changed

End_to_end_Solutions/AOAISearchDemo/app/data/app.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,8 @@ def create_resource(resource_id: str):
309309
logging.error("An error occurred while creating resource: %s", e, exc_info=True)
310310
return Response(response="An internal error has occurred.", status=400)
311311
except CosmosConflictError as e:
312-
return Response(response=str(e), status=409)
312+
logging.error("A conflict occurred while creating resource: %s", e, exc_info=True)
313+
return Response(response="A conflict occurred while creating the resource.", status=409)
313314
except Exception as e:
314315
logging.error("An error occurred while creating resource: %s", e, exc_info=True)
315316
return Response(response="An internal error has occurred.", status=500)

0 commit comments

Comments
 (0)