pub fn check_error_on_exception<T>(env: &JNIEnv, result: JniResult<T>) -> Result<T, String> {
    result.map_err(|jni_error| match jni_error.0 {
        JniErrorKind::JavaException => {
            let exception = get_and_clear_java_exception(env);
            let message = describe_java_exception(env, exception);
            if unwrap_jni_verbose(env, env.is_instance_of(exception, CLASS_JL_ERROR)) {
                panic!(message);
            }
            message
        }
        _ => unwrap_jni(Err(jni_error)),
    })
}
/// Handles and describes non-fatal Java exceptions.
///
/// Java exceptions are converted into `Error`s with their descriptions, Java errors and JNI errors
/// are treated as unrecoverable and result in a panic.
///
/// Panics:
/// - Panics if there is some JNI error.
/// - If there is a pending Java exception that is a subclass of `java.lang.Error`.
Handles and describes non-fatal Java exceptions.
Java exceptions are converted into `Error`s with their descriptions, Java errors and JNI errors
are treated as unrecoverable and result in a panic.

Panics if there is some JNI error.
If there is a pending Java exception that is a subclass of `java.lang.Error`.
Handles and describes non - fatal Java exceptions . Java exceptions are converted into ` Error ` s with their descriptions Java errors and JNI errors are treated as unrecoverable and result in a panic . Panics if there is some JNI error . If there is a pending Java exception that is a subclass of ` java . lang . Error ` .
pub fn check_error_on_exception<T>(env: &JNIEnv, result: JniResult<T>) -> Result<T, String> {
    result.map_err(|jni_error| match jni_error.0 {
        JniErrorKind::JavaException => {
            let exception = get_and_clear_java_exception(env);
            let message = describe_java_exception(env, exception);
            if unwrap_jni_verbose(env, env.is_instance_of(exception, CLASS_JL_ERROR)) {
                panic!(message);
            }
            message
        }
        _ => unwrap_jni(Err(jni_error)),
    })
}
pub fn check_error_on_exception < T > ( env : & JNIEnv , result : JniResult < T > ) -> Result < T , String > { result . map_err ( | jni_error | match jni_error . 0 { JniErrorKind :: JavaException => { let exception = get_and_clear_java_exception ( env ) ; let message = describe_java_exception ( env , exception ) ; if unwrap_jni_verbose ( env , env . is_instance_of ( exception , CLASS_JL_ERROR ) ) { panic ! ( message ) ; } message } _ => unwrap_jni ( Err ( jni_error ) ) , } ) }
Handles and describes non-fatal Java exceptions.
Handles and describes non - fatal Java exceptions .
env
&JNIEnv
result
JniResult<T>