mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Python: clean up exception (#2319)
* Potential fix for code scanning alert no. 18: Information exposure through an exception Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> * Fix test --------- Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
Unverified
parent
4fcc5a4b7d
commit
99689add09
@@ -91,4 +91,4 @@ def add_agent_framework_fastapi_endpoint(
|
||||
)
|
||||
except Exception as e:
|
||||
logger.error(f"Error in agent endpoint: {e}", exc_info=True)
|
||||
return {"error": str(e)}
|
||||
return {"error": "An internal error has occurred."}
|
||||
|
||||
@@ -154,7 +154,7 @@ async def test_endpoint_error_handling():
|
||||
assert response.status_code == 200
|
||||
content = json.loads(response.content)
|
||||
assert "error" in content
|
||||
assert "Expecting value" in content["error"]
|
||||
assert content["error"] == "An internal error has occurred."
|
||||
|
||||
|
||||
async def test_endpoint_multiple_paths():
|
||||
|
||||
Reference in New Issue
Block a user