I have some logic in native method, which returns sth or null - they are both valid and meaningful states, and I want to throw an exception on method's failure. As it is native JSNI i am not sure how to do that.
So consider method:
public final native <T> T myNativeMethod() /*-{
//..some code
//in javascript you can throw anything, not only the exception object:
throw "something";
}-*/;
but how to catch the thrown object?
void test() {
try {
myNativeMethod();
}
catch(Throwable e) { // what to catch here???
}
}
Is there any special Gwt Exception Type wrapping "exception objects" thrown from JSNI?