mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-14 23:21:35 +00:00
fix(proxy): simplify error_msg assignment and restore security comment
Remove dead if/else branches (both assigned str(e)); keep single assignment with comment explaining why traceback is excluded from SSE response. Made-with: Cursor
This commit is contained in:
parent
51241870ea
commit
de6494d86f
1 changed files with 4 additions and 4 deletions
|
|
@ -5542,10 +5542,10 @@ async def _async_data_generator_emit_error(
|
|||
)
|
||||
if isinstance(e, HTTPException):
|
||||
raise e
|
||||
if isinstance(e, StreamingCallbackError):
|
||||
error_msg = str(e)
|
||||
else:
|
||||
error_msg = str(e)
|
||||
# Only include the error message, not the traceback.
|
||||
# The traceback is already logged above via verbose_proxy_logger.exception().
|
||||
# Including it in the SSE response leaks internal details to clients.
|
||||
error_msg = str(e)
|
||||
proxy_exception = ProxyException(
|
||||
message=getattr(e, "message", error_msg),
|
||||
type=getattr(e, "type", "None"),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue