Refactor ErrorFrame: rename source field to processor for clarity and update related references in FrameProcessor.

This commit is contained in:
richtermb
2025-08-05 13:25:08 -07:00
parent 4476a76ad7
commit efddc4732c
3 changed files with 4 additions and 4 deletions

View File

@@ -657,7 +657,7 @@ class ErrorFrame(SystemFrame):
error: str
fatal: bool = False
source: Optional["FrameProcessor"] = None
processor: Optional["FrameProcessor"] = None
def __str__(self):
return f"{self.name}(error: {self.error}, fatal: {self.fatal})"

View File

@@ -494,8 +494,8 @@ class FrameProcessor(BaseObject):
Args:
error: The error frame to push.
"""
if not error.source:
error.source = self
if not error.processor:
error.processor = self
await self.push_frame(error, FrameDirection.UPSTREAM)
async def push_frame(self, frame: Frame, direction: FrameDirection = FrameDirection.DOWNSTREAM):