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

Better exception annotations for C++ API #3391

Open
mewim opened this issue Apr 27, 2024 · 0 comments
Open

Better exception annotations for C++ API #3391

mewim opened this issue Apr 27, 2024 · 0 comments
Labels

Comments

@mewim
Copy link
Collaborator

mewim commented Apr 27, 2024

For current C++ APIs, it is not quite clear which functions may throw an exception and which functions do not throw. It also causes some issue for the client API bindings. It’s less of an issue for Python as pybind11 automatically converts C++ exceptions to Python exceptions, but for Java and C API bindings, it is not very clear which functions needs a try-catch and which ones does not, which may cause exceptions not caught and crash user’s process. We should consider systematically assess and annotate which API functions may throw. If it may throw, we should add an annotation to the docstring. Otherwise, we should mark it as noexcept.

@mewim mewim added the apis label Apr 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant