https://prefect.io logo
Title
d

Derek Izuel

08/30/2019, 7:59 PM
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

Chris White

08/30/2019, 8:09 PM
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:
from prefect.engine.state import Failed
d

Derek Izuel

08/30/2019, 8:28 PM
totally missed that - thank you!
c

Chris White

08/30/2019, 8:29 PM
anytime!