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

Catch C++ exceptions from node_map functions #11

Merged
merged 1 commit into from
May 29, 2024

Conversation

hirschenberger
Copy link
Collaborator

By returning a PylonResult from the node_map function all thrown C++ exceptions are automatically caught and converted to PylonResult by cxx.

fixes #10

By returning a `PylonResult` from the `node_map` function all thrown C++ exceptions
are automatically caught and converted to PylonResult by cxx.
@hirschenberger
Copy link
Collaborator Author

hirschenberger commented Apr 5, 2024

I tested my code by adding a throw GenICam::RuntimeException("XX", "XX", 42); to pylon-cxx-rs.cc:72 and ran PYLON_CAMEMU=1 cargo run --example grab

@hirschenberger
Copy link
Collaborator Author

@astraw Did you have time to look into that?

@astraw astraw merged commit 8124ae4 into strawlab:main May 29, 2024
@astraw
Copy link
Member

astraw commented May 29, 2024

Thanks for the ping. Now I finally merged this and released it as 0.4.0.

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.

Proper C++ exception handling
2 participants