Rethrowing an exception via JNI ?
What's the proper way to rethrow an exception in JNI?
int result = env->CallIntMethod(
obj, methID, arg
);
if ( jthrowable t = env->ExceptionOccurred() ) {
env->ExceptionClear(); // should this be called here?
env->Throw( t ); // what about this?
}
The JNI documetation I've seen doesn't talk about this. If all
one wants to to is "notice" the exception (but not really
"catch" it), what does one do? I don't really want to "catch"
it, just pass it back to the Java side.
- Paul
.
Relevant Pages
- Re: Returning Errors in COM+ using Autocomplete
... I dont understand the last sentecen, How can i rethrow and throw a new ... exception, could you show me some code? ... Alfredo Barrientos ... Prev by Date: ... (microsoft.public.dotnet.framework.component_services) - Re: JNI problem with GetStringUTFLength
... I am not experienced enough in JNI to help you, ... it seems that you have not included the exact Exception ... "A simple prop to occupy my time.." ... Prev by Date: ... (comp.lang.java.programmer) - RE: Why is the compiler flagging this variable as unassigned?
... I didn't see this in any of the replies, but if you write the catch block ... you will rethrow the exception that you received with no changes. ... Prev by Date: ... (microsoft.public.dotnet.languages.csharp) - Re: using serialization to serialize my objects to hard drive
... stack trace for the exception. ... simply have the throw statement by itself to rethrow the ... inner exception. ... Prev by Date: ... (microsoft.public.dotnet.csharp.general) - Re: trouble passing float array from C to java method
... running in the background and calling my Java function when it gathers ... After every call to JNI you should check for errors (there are, in fact, a few ... This can fail. ... This can fail by throwing a Java exception. ... (comp.lang.java.programmer) |
|