mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-08 03:08:45 +00:00
Potential fix for code scanning alert no. 4045: Information exposure through an exception
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
This commit is contained in:
parent
0c3c1d4c70
commit
77cfaa0870
1 changed files with 7 additions and 2 deletions
|
|
@ -102,12 +102,17 @@ async def _handle_stream_message(
|
|||
else:
|
||||
yield "data: " + json.dumps(chunk) + "\n\n"
|
||||
except Exception as e:
|
||||
verbose_proxy_logger.exception(f"Error streaming A2A response: {e}")
|
||||
# Log full exception details server-side for debugging
|
||||
verbose_proxy_logger.exception("Error streaming A2A response")
|
||||
# Return a generic error message to the client without exposing internal details
|
||||
yield "data: " + json.dumps(
|
||||
{
|
||||
"jsonrpc": "2.0",
|
||||
"id": request_id,
|
||||
"error": {"code": -32603, "message": f"Streaming error: {str(e)}"},
|
||||
"error": {
|
||||
"code": -32603,
|
||||
"message": "Streaming error",
|
||||
},
|
||||
}
|
||||
) + "\n\n"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue