Hello! I’m trying to figure out why my local runs ...
# ask-community
i
Hello! I’m trying to figure out why my local runs differ from prefect cloud. I expect that my task will handle exception, and it perfectly works local, but in cloud my flow fails with strange error message “‘traceback’ object is not subscriptable”. How can I fix this?
a
You can remove all try except blocks and this should fix your issue - no need to trap exceptions if you are using Prefect
i
Thank you for your answer, but I use try except for validation logic in my flow and it has multiple layers. Is there any convenient way to use try except in prefect?
a
there certainly is, but you shouldn't need to use try except when you use Prefect - try/except traps an exception. in contrast, with Prefect you can actively use an exception to drive further actions e.g. via triggers and state handlers • https://docs.prefect.io/core/concepts/execution.html#triggershttps://docs.prefect.io/core/concepts/notifications.html#state-handlers
🙏 1