Skip to content

Commit c32f783

Browse files
committed
fix: fix error handling
1 parent 8b9be5a commit c32f783

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

interface/ten_ai_base/tts2_http.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -498,14 +498,16 @@ async def _handle_error_with_text_input_end(
498498
text_input_end: Whether text_input_end was received
499499
"""
500500
await self.send_tts_error(request_id=request_id, error=error)
501-
501+
502502
if text_input_end:
503-
self.ten_env.log_info(
504-
f"Error occurred after text_input_end for request {request_id}, "
505-
f"sending tts_audio_end with ERROR reason",
506-
category=LOG_CATEGORY_KEY_POINT,
507-
)
503+
# Send audio_end and finish
508504
await self._send_audio_end_and_finish(
509505
request_id=request_id,
510506
reason=TTSAudioEndReason.ERROR,
511507
)
508+
else:
509+
# Just finish the request without audio_end
510+
await self.finish_request(
511+
request_id=request_id,
512+
reason=TTSAudioEndReason.ERROR,
513+
)

0 commit comments

Comments
 (0)