rJava
rJava copied to clipboard
basic error message from rniEval
Very basic. How would you prefer the integration with the current structure? I can't create an REngineEvalException from the JNI because I don't have access to the engine.
Long version with REngineEvalException:
jclass clazz = (*env)->FindClass(env, "org/rosuda/REngine/REngineEvalException");
jstring message = (*env)->NewStringUTF(env, R_curErrorBuf())
jmethodID init = (*env)->GetMethodID(env, cls, "<init>", "(Lorg/rosuda/REngine;Ljava/lang/String;)V");
jobject exception = (*env)->NewObject(env, clazz, init, engine, message)
(*env)->Throw(env, exception);
Anyone got time to review this?