From bbd5c3b487613ae68f11fba445a24ad3f69df0cb Mon Sep 17 00:00:00 2001 From: Mark Backman Date: Wed, 26 Nov 2025 08:46:03 -0500 Subject: [PATCH] Update push_error_frame to log error --- src/pipecat/processors/frame_processor.py | 2 +- src/pipecat/services/asyncai/tts.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pipecat/processors/frame_processor.py b/src/pipecat/processors/frame_processor.py index b117cec83..97fe6b7f6 100644 --- a/src/pipecat/processors/frame_processor.py +++ b/src/pipecat/processors/frame_processor.py @@ -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): diff --git a/src/pipecat/services/asyncai/tts.py b/src/pipecat/services/asyncai/tts.py index 11b531f68..4c9c0c96c 100644 --- a/src/pipecat/services/asyncai/tts.py +++ b/src/pipecat/services/asyncai/tts.py @@ -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):