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 errors on return type much harder to achieve in PyPANDA #1468

Merged
merged 3 commits into from
May 10, 2024

Conversation

lacraig2
Copy link
Member

This is a draft for code that would need to be propagated to other parts of PyPANDA to make it much harder for callbacks to error on the incorrect type returned from a callback.

In this case we move the type conversion that cffi would do upon return of our outer callback wrapper to the forefront and check it for errors. If there is an error we make an explicit offering of a type cast from zero.

This should be handled in the other _run_and_catch functions. It should also have a better policy on errors. Printing every time is annoying, but some feedback is useful.

@lacraig2 lacraig2 marked this pull request as ready for review May 9, 2024 18:33
@lacraig2 lacraig2 requested a review from AndrewFasano May 9, 2024 18:33
Copy link
Member

@AndrewFasano AndrewFasano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable to me, assuming you've run it and it worked.

@lacraig2 lacraig2 merged commit 14c4f55 into dev May 10, 2024
8 checks passed
@lacraig2 lacraig2 deleted the no_return_errors_pypanda branch May 10, 2024 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants