Detect and raise exception on .py script

Hello,

I’m trying to catch an exception in a python script.
I’d like to do something when I catch the exception but then I’d like the flow to fail so it can trigger the correct notifications. If when I trap the exception then I do raise(“xxx”) the flow doesn’t continue

How can I make the node “.py File” go to the next “ERR” node?

Thanks,
Ana

To add more information.

This also happens (job gets stuck) if there is an error in the code.
I was expecting this would throw an exception and make the job fail (and finish) but it just gets stuck.

Any ideas?