chore(graph_engine): Move error_strategy.py to protocols/

Signed-off-by: -LAN- <laipz8200@outlook.com>
This commit is contained in:
-LAN- 2025-08-28 04:29:32 +08:00
parent 65617f000d
commit 8129ca7c05
No known key found for this signature in database
GPG Key ID: 6BA0D108DED011FF
2 changed files with 2 additions and 4 deletions

View File

@ -8,7 +8,6 @@ the Strategy pattern for clean separation of concerns.
from .abort_strategy import AbortStrategy
from .default_value_strategy import DefaultValueStrategy
from .error_handler import ErrorHandler
from .error_strategy import ErrorStrategy
from .fail_branch_strategy import FailBranchStrategy
from .retry_strategy import RetryStrategy
@ -16,7 +15,6 @@ __all__ = [
"AbortStrategy",
"DefaultValueStrategy",
"ErrorHandler",
"ErrorStrategy",
"FailBranchStrategy",
"RetryStrategy",
]

View File

@ -2,7 +2,7 @@
Base error strategy protocol.
"""
from typing import Optional, Protocol
from typing import Protocol
from core.workflow.graph import Graph
from core.workflow.graph_events import GraphNodeEventBase, NodeRunFailedEvent
@ -16,7 +16,7 @@ class ErrorStrategy(Protocol):
node execution failures.
"""
def handle_error(self, event: NodeRunFailedEvent, graph: Graph, retry_count: int) -> Optional[GraphNodeEventBase]:
def handle_error(self, event: NodeRunFailedEvent, graph: Graph, retry_count: int) -> GraphNodeEventBase | None:
"""
Handle a node failure event.