fix: fillter exception handling

This commit is contained in:
Timothy Jaeryang Baek
2025-09-01 14:14:20 +04:00
parent 4b97884fce
commit f56889c5c7
3 changed files with 23 additions and 9 deletions

View File

@@ -885,7 +885,7 @@ async def process_chat_payload(request, form_data, user, metadata, model):
extra_params=extra_params,
)
except Exception as e:
raise Exception(f"Error: {e}")
raise Exception(f"{e}")
features = form_data.pop("features", None)
if features:
@@ -1316,7 +1316,7 @@ async def process_chat_response(
{
"type": "chat:message:error",
"data": {"error": {"content": error}},
},
}
)
if "selected_model_id" in response_data:
@@ -2624,7 +2624,7 @@ async def process_chat_response(
await background_tasks_handler()
except asyncio.CancelledError:
log.warning("Task was cancelled!")
await event_emitter({"type": "task-cancelled"})
await event_emitter({"type": "chat:tasks:cancel"})
if not ENABLE_REALTIME_CHAT_SAVE:
# Save message in the database