Refactor ErrorFrame: rename source field to processor for clarity and update related references in FrameProcessor.
This commit is contained in:
@@ -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})"
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user