public class JSException extends RuntimeException
Thrown when an exception is raised in the JavaScript engine.
Much of the functionality in this class is deprecated as it is
not portable between web browsers. The only functionality that
should be relied upon is the throwing of this exception and calls
to printStackTrace()
.
Modifier and Type | Field and Description |
---|---|
static int |
EXCEPTION_TYPE_BOOLEAN
Deprecated.
Not portable between web browsers.
|
static int |
EXCEPTION_TYPE_EMPTY
Deprecated.
Not portable between web browsers.
|
static int |
EXCEPTION_TYPE_ERROR
Deprecated.
Not portable between web browsers.
|
static int |
EXCEPTION_TYPE_FUNCTION
Deprecated.
Not portable between web browsers.
|
static int |
EXCEPTION_TYPE_NUMBER
Deprecated.
Not portable between web browsers.
|
static int |
EXCEPTION_TYPE_OBJECT
Deprecated.
Not portable between web browsers.
|
static int |
EXCEPTION_TYPE_STRING
Deprecated.
Not portable between web browsers.
|
static int |
EXCEPTION_TYPE_VOID
Deprecated.
Not portable between web browsers.
|
protected String |
filename
Deprecated.
Not portable between web browsers.
|
protected int |
lineno
Deprecated.
Not portable between web browsers.
|
protected String |
message
Deprecated.
Not portable between web browsers.
|
protected String |
source
Deprecated.
Not portable between web browsers.
|
protected int |
tokenIndex
Deprecated.
Not portable between web browsers.
|
Constructor and Description |
---|
JSException()
Constructs a JSException object.
|
JSException(int wrappedExceptionType,
Object wrappedException)
Deprecated.
Not portable between web browsers.
|
JSException(String s)
Construct a JSException object with a detail message.
|
JSException(String s,
String filename,
int lineno,
String source,
int tokenIndex)
Deprecated.
Not portable between web browsers.
|
Modifier and Type | Method and Description |
---|---|
Object |
getWrappedException()
Deprecated.
Not portable between web browsers.
|
int |
getWrappedExceptionType()
Deprecated.
Not portable between web browsers.
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public static final int EXCEPTION_TYPE_EMPTY
public static final int EXCEPTION_TYPE_VOID
public static final int EXCEPTION_TYPE_OBJECT
public static final int EXCEPTION_TYPE_FUNCTION
public static final int EXCEPTION_TYPE_STRING
public static final int EXCEPTION_TYPE_NUMBER
public static final int EXCEPTION_TYPE_BOOLEAN
public static final int EXCEPTION_TYPE_ERROR
protected String message
The detail message.
protected String filename
The URL of the file where the error occurred, if possible.
protected int lineno
The line number if the file, if possible.
protected String source
The string containing the JavaScript code being evaluated.
protected int tokenIndex
The index into the source string where the error occurred.
public JSException()
Constructs a JSException object.
public JSException(String s)
Construct a JSException object with a detail message.
s
- The detail messagepublic JSException(String s, String filename, int lineno, String source, int tokenIndex)
Construct a JSException object. This constructor is deprecated as it involves non-portable functionality.
s
- The detail message.filename
- The URL of the file where the error occurred, if possible.lineno
- The line number if the file, if possible.source
- The string containing the JavaScript code being evaluated.tokenIndex
- The index into the source string where the error occurred.public JSException(int wrappedExceptionType, Object wrappedException)
Construct a JSException object. This constructor is deprecated as it involves non-portable functionality.
wrappedExceptionType
- Type of the wrapped JavaScript exception.wrappedException
- JavaScript exception wrapper.public int getWrappedExceptionType()
getWrappedExceptionType returns the int mapping of the type of the wrappedException Object. This method is deprecated as it involves non-portable functionality.
public Object getWrappedException()
Returns the wrapped JavaScript exception. This method is deprecated as it involves non-portable functionality.
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 2008, 2020, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.