internal JNetThrowableException(JNetRuntime runtime, jthrowable throwable)
            : base(GetMessage(runtime, throwable))
        {
            // TODO: enrich exception information (asynchronously)

            Throwable = throwable;
        }
        private static string GetMessage(JNetRuntime runtime, jthrowable throwable)
        {
            // TODO: Can we get 'throwable' message asynchronously (using another runtime instance)?

            var clz_Throwable = runtime.GetObjectClass(throwable);

            var mid_GetMessage = runtime.GetMethodID(clz_Throwable, "getMessage", "()Ljava/lang/String;");
            var jmessage       = (jstring)runtime.CallObjectMethod(throwable, mid_GetMessage);

            return(runtime.ToString(jmessage));
        }
예제 #3
0
 // Throw
 public jint Throw(jthrowable obj)
 => functions->Throw(env, obj);