public final class JavaScriptException
extends java.lang.RuntimeException
The return value of Throwable.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, Throwable.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();
}
}
| Modifier | Constructor and Description |
|---|---|
|
JavaScriptException(java.lang.Object e) |
|
JavaScriptException(java.lang.Object e,
java.lang.String description) |
protected |
JavaScriptException(java.lang.String message)
Used for server-side instantiation during JUnit runs.
|
|
JavaScriptException(java.lang.String name,
java.lang.String description) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getDescription()
Returns the original JavaScript message of the exception; may be
null. |
JavaScriptObject |
getException()
Returns the original JavaScript the exception; may be
null. |
java.lang.String |
getMessage() |
java.lang.String |
getName()
Returns the original JavaScript type name of the exception; may be
null. |
public JavaScriptException(java.lang.Object e)
e - the object caught in JavaScript that triggered the exceptionpublic JavaScriptException(java.lang.Object e,
java.lang.String description)
e - the object caught in JavaScript that triggered the exceptiondescription - to include in getMessage(), e.g. at the top of a stack
tracepublic JavaScriptException(java.lang.String name,
java.lang.String description)
protected JavaScriptException(java.lang.String message)
com.google.gwt.junit.client.impl.ExceptionWrapper objects.message - the detail messagepublic java.lang.String getDescription()
null.public JavaScriptObject getException()
null.public java.lang.String getMessage()
getMessage in class java.lang.Throwablepublic java.lang.String getName()
null.