Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make run_locally(ensure_success=True) raise the actual encountered exception #611

Open
janosh opened this issue May 14, 2024 · 3 comments
Open
Labels
ux User experience

Comments

@janosh
Copy link
Member

janosh commented May 14, 2024

when debugging a failing workflow with run_locally, it can be very helpful to have access to the exception object. currently, you always get the same generic error:

raise RuntimeError("Flow did not finish running successfully")

to see what went wrong, you have to run with

run_locally(log=True, ensure_success=True)

and then hunt for the error message in the logs which can be verbose

how about we raise the actual error message instead of this generic RuntimeError? a (possibly bad style) sketch of how to implement this:

Screenshot 2024-05-14 at 16 48 48

for the above to work, _run_job would have to be modified to return the caught exception:

Screenshot 2024-05-14 at 16 54 45

@janosh janosh added the ux User experience label May 14, 2024
@janosh
Copy link
Member Author

janosh commented May 14, 2024

pinging @utf @Andrew-S-Rosen @JaGeo in case you have thoughts?

@jmmshn
Copy link
Contributor

jmmshn commented Jun 6, 2024

Second this.

Also,
The raise_immediately flag kind of handles this:

raise_immediately: bool = False,

I feel real-world exceptions are so deep down the call stack that reading things becomes problematic.
I have been running this flag and

ipython --pdb test.py

to debug workflows and it's been pretty effective.

@janosh
Copy link
Member Author

janosh commented Jun 6, 2024

thanks for the tip! i'll give the raise_immediately=True + ipython --pdb combo a try

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ux User experience
Projects
None yet
Development

No branches or pull requests

2 participants