JavaClassWrapper: Allow handling exceptions (rather than just crashing)

This commit is contained in:
David Snopek
2025-02-14 09:27:40 -06:00
parent b607110ad2
commit 5d69d20059
4 changed files with 29 additions and 0 deletions

View File

@@ -271,6 +271,8 @@ class JavaClassWrapper : public Object {
bool _get_type_sig(JNIEnv *env, jobject obj, uint32_t &sig, String &strsig);
#endif
Ref<JavaObject> exception;
Ref<JavaClass> _wrap(const String &p_class, bool p_allow_private_methods_access);
static JavaClassWrapper *singleton;
@@ -285,6 +287,10 @@ public:
return _wrap(p_class, false);
}
Ref<JavaObject> get_exception() {
return exception;
}
#ifdef ANDROID_ENABLED
Ref<JavaClass> wrap_jclass(jclass p_class, bool p_allow_private_methods_access = false);
#endif