Update push_error_frame to log error

This commit is contained in:
Mark Backman
2025-11-26 08:46:03 -05:00
parent c6fcf58be4
commit bbd5c3b487
2 changed files with 3 additions and 3 deletions

View File

@@ -665,7 +665,6 @@ class FrameProcessor(BaseObject):
```
"""
error_message = error_msg or f"{self} exception: {exception}"
logger.error(error_message)
error_frame = ErrorFrame(
error=error_message, fatal=fatal, exception=exception, processor=self
)
@@ -680,6 +679,7 @@ class FrameProcessor(BaseObject):
if not error.processor:
error.processor = self
await self._call_event_handler("on_error", error)
logger.error(error.error)
await self.push_frame(error, FrameDirection.UPSTREAM)
async def push_frame(self, frame: Frame, direction: FrameDirection = FrameDirection.DOWNSTREAM):

View File

@@ -332,14 +332,14 @@ class AsyncAITTSService(InterruptibleTTSService):
await self._get_websocket().send(msg)
await self.start_tts_usage_metrics(text)
except Exception as e:
await self.push_error(exception=e)
yield ErrorFrame(error=f"{self} error: {e}")
yield TTSStoppedFrame()
await self._disconnect()
await self._connect()
return
yield None
except Exception as e:
await self.push_error(exception=e)
yield ErrorFrame(error=f"{self} error: {e}")
class AsyncAIHttpTTSService(TTSService):