Merge pull request #103571 from timothyqiu/wrap-not-found

Improve error message from `JavaClassWrapper.wrap()`
This commit is contained in:
Thaddeus Crews 2025-03-11 09:34:45 -05:00
commit dcbddb64d5
No known key found for this signature in database
GPG key ID: 62181B86FE9E5D84

View file

@ -1471,7 +1471,7 @@ Ref<JavaClass> JavaClassWrapper::_wrap(const String &p_class, bool p_allow_priva
ERR_FAIL_NULL_V(env, Ref<JavaClass>());
jclass bclass = env->FindClass(class_name_dots.replace(".", "/").utf8().get_data());
ERR_FAIL_NULL_V(bclass, Ref<JavaClass>());
ERR_FAIL_NULL_V_MSG(bclass, Ref<JavaClass>(), vformat("Java class '%s' not found.", p_class));
jobjectArray constructors = (jobjectArray)env->CallObjectMethod(bclass, Class_getDeclaredConstructors);
ERR_FAIL_NULL_V(constructors, Ref<JavaClass>());