Sorry to bump it, is because i faced some issues using:
Copy code
try:
...
except Exception as err:
pass
and raising fail signal it was not being catched.
a
Anna Geller
11/21/2022, 10:38 PM
what problem are you trying to solve?
Anna Geller
11/21/2022, 10:41 PM
you don't need to use try/except necessarily when you use Prefect, signals were needed in v1 to do things like skipping some tasks, raising a retry signal to cause a rerun of something or pausing the execution in some other way.
once you migrate to v2, you can use native python so signals won't be required
Anna Geller
11/21/2022, 10:43 PM
internally in v1 we are using those signals to bypass all other exception handling since they are signals not actual errors
Anna Geller
11/21/2022, 10:44 PM
but those shouldn’t be caught unless you want to use them e.g. raise SKIP or RETRY signal
f
FuETL
11/22/2022, 12:54 PM
@Anna Geller Thanks for the answer (i using v1), basically my usage is i have a task lets say with 3 retries.
If is the last retry (before raise FAIL signal again), i need to send a e-mail to notify the interested parties, so inside my task i raise SIGNAL and catch them in the
except
statement, that was the cause of this question.
FuETL
11/22/2022, 12:56 PM
and of course if is last time i send the email and then raise the signal 😄
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.