Hello all, I have what I think is a simple questio...
# ask-community
m
Hello all, I have what I think is a simple question: I have a flow that creates a container, waits on the container, and then gets the container logs. How can I have it throw an error and bail out on things if the WaitOnContainer has a failure in it? I have a slack notifier set up to only output failure, but it is not notifying upon failure of WaitonContainer. Flow code for reference in the thread
start = StartContainer()
l`ogs = GetContainerLogs(trigger=always_run)`
status_code = WaitOnContainer()
## set task dependencies via functional API
with Flow(name="ispottv",
state_handlers=[slack_notifier],
) as flow:
start_container = start(container_id=container)
code = status_code(container_id=container, upstream_tasks=[start_container])
collect_logs = logs(container_id=container, upstream_tasks=[code])
i
Can you write a task to parse the logs for the fail message? And then use a
signals
? https://docs.prefect.io/core/getting_started/next-steps.html#signals