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: Handle exception thrown from native side #61

Merged
merged 1 commit into from
Feb 20, 2024

Conversation

sunchao
Copy link
Member

@sunchao sunchao commented Feb 20, 2024

Which issue does this PR close?

Closes #.

Rationale for this change

Currently when invoking JVM methods from the native side, we do not handle potential exceptions being thrown as part of the process. Ideally, we should catch them and propagate the error to the JVM side to make them visible to the users.

What changes are included in this PR?

This PR catches exceptions thrown from native side via calling Java methods, and convert them into a CometError::JavaException which can then be properly propagated to the JVM.

How are these changes tested?

It is a bit hard to add a unit test for this. I tested it manually instead.

This PR catches exceptions thrown from native side via calling Java methods, and convert them into a `CometError::JavaException` which can then be properly propagated to the JVM.
@sunchao sunchao merged commit 180f962 into apache:main Feb 20, 2024
6 checks passed
@sunchao
Copy link
Member Author

sunchao commented Feb 20, 2024

Thanks, merged

@sunchao sunchao deleted the handle-native-exception branch February 20, 2024 20:46
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