Class JSException
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- netscape.javascript.JSException
All Implemented Interfaces:
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().
See Also:
-
Field Summary
Fields Modifier and Type Field and Description static intEXCEPTION_TYPE_BOOLEANDeprecated.Not portable between web browsers.static intEXCEPTION_TYPE_EMPTYDeprecated.Not portable between web browsers.static intEXCEPTION_TYPE_ERRORDeprecated.Not portable between web browsers.static intEXCEPTION_TYPE_FUNCTIONDeprecated.Not portable between web browsers.static intEXCEPTION_TYPE_NUMBERDeprecated.Not portable between web browsers.static intEXCEPTION_TYPE_OBJECTDeprecated.Not portable between web browsers.static intEXCEPTION_TYPE_STRINGDeprecated.Not portable between web browsers.static intEXCEPTION_TYPE_VOIDDeprecated.Not portable between web browsers.protected StringfilenameDeprecated.Not portable between web browsers.protected intlinenoDeprecated.Not portable between web browsers.protected StringmessageDeprecated.Not portable between web browsers.protected StringsourceDeprecated.Not portable between web browsers.protected inttokenIndexDeprecated.Not portable between web browsers.
-
Constructor Summary
Constructors 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.
-
Method Summary
All MethodsInstance MethodsConcrete MethodsDeprecated Methods Modifier and Type Method and Description ObjectgetWrappedException()Deprecated.Not portable between web browsers.intgetWrappedExceptionType()Deprecated.Not portable between web browsers.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
Field Detail
-
EXCEPTION_TYPE_EMPTY
public static final int EXCEPTION_TYPE_EMPTY
Deprecated. Not portable between web browsers.See Also:
-
EXCEPTION_TYPE_VOID
public static final int EXCEPTION_TYPE_VOID
Deprecated. Not portable between web browsers.See Also:
-
EXCEPTION_TYPE_OBJECT
public static final int EXCEPTION_TYPE_OBJECT
Deprecated. Not portable between web browsers.See Also:
-
EXCEPTION_TYPE_FUNCTION
public static final int EXCEPTION_TYPE_FUNCTION
Deprecated. Not portable between web browsers.See Also:
-
EXCEPTION_TYPE_STRING
public static final int EXCEPTION_TYPE_STRING
Deprecated. Not portable between web browsers.See Also:
-
EXCEPTION_TYPE_NUMBER
public static final int EXCEPTION_TYPE_NUMBER
Deprecated. Not portable between web browsers.See Also:
-
EXCEPTION_TYPE_BOOLEAN
public static final int EXCEPTION_TYPE_BOOLEAN
Deprecated. Not portable between web browsers.See Also:
-
EXCEPTION_TYPE_ERROR
public static final int EXCEPTION_TYPE_ERROR
Deprecated. Not portable between web browsers.See Also:
-
message
protected String message
Deprecated. Not portable between web browsers.The detail message.
-
filename
protected String filename
Deprecated. Not portable between web browsers.The URL of the file where the error occurred, if possible.
-
lineno
protected int lineno
Deprecated. Not portable between web browsers.The line number if the file, if possible.
-
source
protected String source
Deprecated. Not portable between web browsers.The string containing the JavaScript code being evaluated.
-
tokenIndex
protected int tokenIndex
Deprecated. Not portable between web browsers.The index into the source string where the error occurred.
-
-
Constructor Detail
-
JSException
public JSException()
Constructs a JSException object.
-
JSException
public JSException(String s)
Construct a JSException object with a detail message.
Parameters:
s- The detail message
-
JSException
public JSException(String s, String filename, int lineno, String source, int tokenIndex)Deprecated. Not portable between web browsers.Construct a JSException object. This constructor is deprecated as it involves non-portable functionality.
Parameters:
s- The detail message.
-
JSException
public JSException(int wrappedExceptionType, Object wrappedException)Deprecated. Not portable between web browsers.Construct a JSException object. This constructor is deprecated as it involves non-portable functionality.
Parameters:
wrappedExceptionType- Type of the wrapped JavaScript exception.
-
-
Method Detail
-
getWrappedExceptionType
public int getWrappedExceptionType()
Deprecated. Not portable between web browsers.getWrappedExceptionType returns the int mapping of the type of the wrappedException Object. This method is deprecated as it involves non-portable functionality.
Returns:
int JavaScript exception type.
-
getWrappedException
public Object getWrappedException()
Deprecated. Not portable between web browsers.Returns the wrapped JavaScript exception. This method is deprecated as it involves non-portable functionality.
Returns:
Object JavaScript exception wrapper.
-
© 2008, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from JavaFX API Documentation.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Java, JavaFX and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.