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

feat(capi): add mechanism to get panic message as const char * #1740

Merged
merged 1 commit into from
Nov 14, 2024

Conversation

tmontaigu
Copy link
Contributor

Previously, when an error occurred in the rust side, the panic message
would get printed to stderr, then the c function would return 1 to
indicate error.

This commit adds the ability to disable the automatic prints of panic
messages and adds functions to get the panic message as a const char *
to allow user better control on how to display error messages.

@cla-bot cla-bot bot added the cla-signed label Oct 31, 2024
@tmontaigu tmontaigu force-pushed the tm/c-api-error branch 6 times, most recently from eec75e0 to 7f4bce9 Compare November 7, 2024 09:39
Copy link
Member

@IceTDrinker IceTDrinker left a comment

Choose a reason for hiding this comment

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

Looks generally ok, should we have a primitive to clear the last error ?

@tmontaigu
Copy link
Contributor Author

Looks generally ok, should we have a primitive to clear the last error ?

Doesn't hurt to have one

Previously, when an error occurred in the rust side, the panic message
would get printed to stderr, then the c function would return 1 to
indicate error.

This commit adds the ability to disable the automatic prints of panic
messages and adds functions to get the panic message as a const char *
to allow user better control on how to display error messages.
@tmontaigu tmontaigu merged commit bb327b0 into main Nov 14, 2024
81 of 86 checks passed
@tmontaigu tmontaigu deleted the tm/c-api-error branch November 14, 2024 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants