← 输入框|github.com|刷新
Skip to content

basic error message from rniEval - #59

Closed
reactormonk wants to merge 1 commit into
s-u:masterfrom
reactormonk:master
Closed

reactormonk wants to merge 1 commit into
s-u:masterfrom
reactormonk:master

Conversation

@reactormonk

Copy link
Copy Markdown

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);

@reactormonk

Copy link
Copy Markdown
Author

Anyone got time to review this?

@s-u

s-u commented Jan 19, 2026

Copy link
Copy Markdown
Owner

Generally, the R code is responsible for the error handling - see tryCatch and if you want more elaborate information (stack traces etc.) see Rserve::Rserve.eval. Doing this in Java/C makes less sense since the facilities are much more limited (you'll appreciate what I mean if you look at the Rserve::Rserve.eval sources :)).

@s-u s-u closed this Jan 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants