feat: log provider errors to console for better insights (#23379)

* fix: log provider errors that were silently swallowed

* Update main.py

* fix: wrap non-JSON SSE error responses in JSON so middleware handles them
This commit is contained in:
Classic298
2026-04-12 18:07:20 -05:00
committed by GitHub
parent 67023037f8
commit 4292358bd5
3 changed files with 23 additions and 1 deletions
+1 -1
View File
@@ -1797,7 +1797,7 @@ async def chat_completion(
finally:
raise # re-raise to ensure proper task cancellation handling
except Exception as e:
log.debug(f'Error processing chat payload: {e}')
log.error('Error processing chat payload: %s', e)
if metadata.get('chat_id') and metadata.get('message_id'):
# Update the chat message with the error
try: