Hey! I'm currently working with the PrefectFutures...
# prefect-cloud
d
Hey! I'm currently working with the PrefectFutures object right now and building off of what I found on a forum post of:
Copy code
task_future.wait()  
    if task_future.get_state().is_failed():
        name_ = task_future.task_run.name
        id_ = task_future.task_run.flow_run_id
        <http://requests.post|requests.post>(
            SLACK_WEBHOOK_URL,
            json={"text": f"The task `{name_}` failed in a flow run `{id_}`"},
        )
Though, I was thinking it'd be wildly helpful for there to also be a way we could also include the error log in there. Is there a way for the error log to be posted to the slack_webhook_url?
j
The
state.message
has the string of the exception:
Copy code
@task
def my_task():
    raise ValueError("I failed!")
gives
state.message='Task run encountered an exception ValueError: I failed!'
but if you want the full traceback you'll have to do something else