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

Expose exception text to C, Python and Rust API's #39

Merged
merged 2 commits into from
Mar 5, 2024

Conversation

benfred
Copy link
Member

@benfred benfred commented Mar 4, 2024

Previously when something went wrong in the Rust or C API - all the end user would see is a CUVS_ERROR return code with no extra indication of what went wrong.

This change exposes the exception text to both the C and Rust api's, and provides a convenience method to automatically catch c++ exceptions, and convert the exception into an error code with the text set appropiately.

Previously when something went wrong in the Rust or C API - all the
end user would see is a `CUVS_ERROR` return code with no extra
indication of what went wrong.

This change exposes the exception text to both the C and Rust api's,
and provides a convenience method to automatically catch c++ exceptions,
and convert the exception into an error code with the text set appropiately.
@benfred benfred requested review from a team as code owners March 4, 2024 22:15
@github-actions github-actions bot added the cpp label Mar 4, 2024
@benfred benfred added improvement Improves an existing functionality non-breaking Introduces a non-breaking change labels Mar 4, 2024
@dantegd
Copy link
Member

dantegd commented Mar 5, 2024

@benfred this is fantastic, @divyegala and me were discussing this since it also affects the Python API, this solution is quite nice!

@benfred benfred requested review from a team as code owners March 5, 2024 17:37
@benfred
Copy link
Member Author

benfred commented Mar 5, 2024

Thanks @dantegd ! I've updated the python side to also have the error text - let me know what you think,

@benfred benfred changed the title Expose exception text to C and Rust API's Expose exception text to C, Python and Rust API's Mar 5, 2024
@cjnolet
Copy link
Member

cjnolet commented Mar 5, 2024

/merge

@rapids-bot rapids-bot bot merged commit b94c1b5 into rapidsai:branch-24.04 Mar 5, 2024
55 checks passed
@benfred benfred deleted the error_text branch March 5, 2024 19:23
difyrrwrzd added a commit to difyrrwrzd/cuvs that referenced this pull request Aug 10, 2024
Previously when something went wrong in the Rust or C API - all the end user would see is a `CUVS_ERROR` return code with no extra indication of what went wrong.

This change exposes the exception text to both the C and Rust api's, and provides a convenience method to automatically catch c++ exceptions, and convert the exception into an error code with the text set appropiately.

Authors:
  - Ben Frederickson (https://github.com/benfred)

Approvers:
  - Dante Gama Dessavre (https://github.com/dantegd)

URL: rapidsai/cuvs#39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CMake cpp improvement Improves an existing functionality non-breaking Introduces a non-breaking change Python
Projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants