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

JavaClassWrapper: Allow handling exceptions (rather than just crashing) #102862

Merged

Conversation

dsnopek
Copy link
Contributor

@dsnopek dsnopek commented Feb 14, 2025

While working on PR #102817, I've come to realize how important this addition is!

Currently, if a developer calls a Java method via JavaClassWrapper that causes an exception, their app will simply crash with this message in the logs (plus lots of other debug info):

JNI DETECTED ERROR IN APPLICATION

This PR will clear the exception (so the app doesn't crash) and provide access to it via JavaClassWrapper.get_exception() so the developer can actually handle the exception.

@dsnopek dsnopek force-pushed the java-class-wrapper-get-exception branch from 92be336 to 11d166b Compare February 14, 2025 15:40
@dsnopek dsnopek force-pushed the java-class-wrapper-get-exception branch from 11d166b to 5d69d20 Compare February 14, 2025 15:45
Copy link
Member

@syntaxerror247 syntaxerror247 left a comment

Choose a reason for hiding this comment

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

Looks good!

@akien-mga akien-mga merged commit 11d8e2e into godotengine:master Feb 14, 2025
20 checks passed
@akien-mga
Copy link
Member

Thanks!

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.

4 participants