
public static class JavaScriptException extends Object
The return value of #getStackTrace() may vary between browsers due to
variations in the underlying error-reporting capabilities. When possible, the
stack trace will be the stack trace of the underlying error object. If it is
not possible to accurately report a stack trace, a zero-length array will be
returned. In those cases where the underlying stack trace cannot be
determined, #fillInStackTrace() can be called in the associated catch
block to create a stack trace corresponding to the location where the
JavaScriptException object was created.
try {
nativeMethod();
} catch (JavaScriptException e) {
if (e.getStackTrace().length == 0) {
e.fillInStackTrace();
}
}
Copyright © 2018. All rights reserved.