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

Improve python/rust boundary error handling #5414

Merged
merged 2 commits into from Feb 2, 2018

Conversation

Projects
None yet
3 participants
@stuhood
Copy link
Member

stuhood commented Feb 1, 2018

Problem

For calls from python to rust, we didn't have a convention in place (with the exception of calls that returned Node values) for returning the equivalent of a rust Result type to python.

Solution

Repurpose an existing Externs struct (RunnableComplete) as PyResult, and use it to remove a panicing TODO that was easy to trip on.

Additionally, rename invoke_runnable to call, and add eval.

Result

Begins to fix #4208 (although we should still close it), and avoids a too-common panic.

@jsirois

jsirois approved these changes Feb 2, 2018

@stuhood stuhood merged commit 2b2f59d into pantsbuild:master Feb 2, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@stuhood stuhood deleted the twitter:stuhood/improve-py-rust-error-handling branch Feb 2, 2018

@illicitonion

This comment has been minimized.

Copy link
Contributor

illicitonion commented Feb 2, 2018

Looks good :) Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment