MCPcopy Create free account
hub / github.com/cretz/stackparam / throw_ex_with_msg

Function throw_ex_with_msg

src/native.rs:423–432  ·  view source on GitHub ↗
(jni_env: *mut JNIEnv, ex_class: &str, ex_msg: &str)

Source from the content-addressed store, hash-verified

421}
422
423unsafe fn throw_ex_with_msg(jni_env: *mut JNIEnv, ex_class: &str, ex_msg: &str) -> Result<(), String> {
424 let ex_class_str = CString::new(ex_class).unwrap();
425 let class = util::result_or_jni_ex((**jni_env).FindClass.unwrap()(jni_env,
426 ex_class_str.as_ptr()), jni_env)?;
427 let ex_msg_str = CString::new(ex_msg).unwrap();
428 if (**jni_env).ThrowNew.unwrap()(jni_env, class, ex_msg_str.as_ptr()) < 0 {
429 return util::result_or_jni_ex((), jni_env);
430 }
431 return Result::Ok(());
432}
433
434unsafe fn get_params(jni_env: *mut JNIEnv,
435 thread: jthread,

Calls 1

result_or_jni_exFunction · 0.85

Tested by

no test coverage detected