docs: put .jclass() in example expansion

This commit is contained in:
əlemi 2024-09-24 05:03:42 +02:00
parent 4d2debf789
commit 9160772fd4
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -87,7 +87,7 @@ pub extern "system" fn Java_mp_code_Client_connect<'local>(
let config_new = match jni_toolbox::from_java_static::<Config>(&mut env, config) {
Ok(x) => x,
Err(e) => {
let _ = env.throw_new("java/lang/RuntimeException", format!("{e:?}"));
let _ = env.throw_new(e.jclass(), format!("{e:?}"));
return std::ptr::null_mut();
}
};
@ -111,7 +111,7 @@ pub extern "system" fn Java_mp_code_Client_connect<'local>(
match ret.into_java(&mut env) {
Ok(fin) => fin,
Err(e) => {
let _ = env.throw_new("java/lang/RuntimeException", format!("{e:?}"));
let _ = env.throw_new(e.jclass(), format!("{e:?}"));
std::ptr::null_mut()
}
}