Propagate method execution failures in Flow class

- Modify Flow class to re-raise exceptions after emitting MethodExecutionFailedEvent
- Reorder MethodExecutionFailedEvent import to maintain consistent import style
This commit is contained in:
Lorenze Jay
2025-02-14 09:10:56 -08:00
parent e17159f877
commit a557275112
2 changed files with 2 additions and 1 deletions

View File

@@ -856,6 +856,7 @@ class Flow(Generic[T], metaclass=FlowMeta):
error=e, error=e,
), ),
) )
raise e
async def _execute_listeners(self, trigger_method: str, result: Any) -> None: async def _execute_listeners(self, trigger_method: str, result: Any) -> None:
""" """

View File

@@ -19,9 +19,9 @@ from .crew_events import (
from .flow_events import ( from .flow_events import (
FlowFinishedEvent, FlowFinishedEvent,
FlowStartedEvent, FlowStartedEvent,
MethodExecutionFailedEvent,
MethodExecutionFinishedEvent, MethodExecutionFinishedEvent,
MethodExecutionStartedEvent, MethodExecutionStartedEvent,
MethodExecutionFailedEvent,
) )
from .task_events import ( from .task_events import (
TaskCompletedEvent, TaskCompletedEvent,