(jni_env: *mut JNIEnv, ex_class: &str, ex_msg: &str)
| 421 | } |
| 422 | |
| 423 | unsafe 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 | |
| 434 | unsafe fn get_params(jni_env: *mut JNIEnv, |
| 435 | thread: jthread, |
no test coverage detected