Hello, I am trying to use the 'gmail_notifier' uti...
# ask-community
d
Hello, I am trying to use the 'gmail_notifier' utility to send me a message when my process fails. I used the code from the example as a state handler for an individual task. just like this: @task(state_handlers=[gmail_notifier(only_states=[Failed])]) and I get the following error: NameError: name 'Failed' is not defined I have tried many different combinations of state classes and ignore/only parameters - I get the same message. Thank you.
c
Hi @Derek Izuel if you haven’t imported the
Failed
state object, then python doesn’t know what you’re referring to. You’ll need to do:
Copy code
from prefect.engine.state import Failed
d
totally missed that - thank you!
c
anytime!