void ThrowH3Exception()

in src/main/c/h3-java/src/jniapi.c [39:57]


void ThrowH3Exception(JNIEnv *env, H3Error err) {
    jclass h3e =
        (**env).FindClass(env, "com/uber/h3core/exceptions/H3Exception");

    if (h3e != NULL) {
        jmethodID h3eConstructor =
            (**env).GetMethodID(env, h3e, "<init>", "(I)V");

        if (h3eConstructor != NULL) {
            jthrowable h3eInstance =
                (jthrowable)((**env).NewObject(env, h3e, h3eConstructor, err));

            if (h3eInstance != NULL) {
                // TODO: Is ExceptionClear needed here?
                (**env).Throw(env, h3eInstance);
            }
        }
    }
}