netscape.javascript

## Class JSException

- java.lang.Object
- - java.lang.Throwable
  - - java.lang.Exception
    - - java.lang.RuntimeException
      - - netscape.javascript.JSException

- All Implemented Interfaces:
    java.io.Serializable

      public class JSException
      extends java.lang.RuntimeException

  JSException is an exception which is thrown when JavaScript code returns an error.
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `EXCEPTION_TYPE_BOOLEAN`
    `static int` | `EXCEPTION_TYPE_EMPTY`
    `static int` | `EXCEPTION_TYPE_ERROR`
    `static int` | `EXCEPTION_TYPE_FUNCTION`
    `static int` | `EXCEPTION_TYPE_NUMBER`
    `static int` | `EXCEPTION_TYPE_OBJECT`
    `static int` | `EXCEPTION_TYPE_STRING`
    `static int` | `EXCEPTION_TYPE_VOID`
    `java.lang.String` | `filename`
    `int` | `lineno`
    `java.lang.String` | `source`
    `int` | `tokenIndex`
    `java.lang.Object` | `wrappedException`
    `int` | `wrappedExceptionType`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `JSException()` Deprecated. Not for public use in future versions.
    `JSException(int wrappedExceptionType, java.lang.Object wrappedException)` Constructs a JSException with a wrapped JavaScript exception object.
    `JSException(java.lang.String s)` Deprecated. Not for public use in future versions.
    `JSException(java.lang.String s, java.lang.String filename, int lineno, java.lang.String source, int tokenIndex)` Deprecated. Not for public use in future versions.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.Object` | `getWrappedException()` Instance method getWrappedException.
    `int` | `getWrappedExceptionType()` Instance method getWrappedExceptionType returns the int mapping of the type of the wrappedException Object.

    - ### Methods inherited from class java.lang.Throwable

      `addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### EXCEPTION_TYPE_EMPTY

          public static final int EXCEPTION_TYPE_EMPTY

      See Also:
        Constant Field Values

    - #### EXCEPTION_TYPE_VOID

          public static final int EXCEPTION_TYPE_VOID

      See Also:
        Constant Field Values

    - #### EXCEPTION_TYPE_OBJECT

          public static final int EXCEPTION_TYPE_OBJECT

      See Also:
        Constant Field Values

    - #### EXCEPTION_TYPE_FUNCTION

          public static final int EXCEPTION_TYPE_FUNCTION

      See Also:
        Constant Field Values

    - #### EXCEPTION_TYPE_STRING

          public static final int EXCEPTION_TYPE_STRING

      See Also:
        Constant Field Values

    - #### EXCEPTION_TYPE_NUMBER

          public static final int EXCEPTION_TYPE_NUMBER

      See Also:
        Constant Field Values

    - #### EXCEPTION_TYPE_BOOLEAN

          public static final int EXCEPTION_TYPE_BOOLEAN

      See Also:
        Constant Field Values

    - #### EXCEPTION_TYPE_ERROR

          public static final int EXCEPTION_TYPE_ERROR

      See Also:
        Constant Field Values

    - #### filename

          public java.lang.String filename

    - #### lineno

          public int lineno

    - #### source

          public java.lang.String source

    - #### tokenIndex

          public int tokenIndex

    - #### wrappedExceptionType

          public int wrappedExceptionType

    - #### wrappedException

          public java.lang.Object wrappedException

  - ### Constructor Detail

    - #### JSException

          @Deprecated
          public JSException()

      Deprecated. Not for public use in future versions.
      Constructs a JSException without a detail message. A detail message is a String that describes this particular exception.

    - #### JSException

          @Deprecated
          public JSException(java.lang.String s)

      Deprecated. Not for public use in future versions.
      Constructs a JSException with a detail message. A detail message is a String that describes this particular exception.
      Parameters:
        `s` - the detail message

    - #### JSException

          public JSException(int wrappedExceptionType,
                             java.lang.Object wrappedException)

      Constructs a JSException with a wrapped JavaScript exception object. This constructor needs to be public so that Java users can throw exceptions to JS cleanly.
      Parameters:
        `wrappedExceptionType` - type of exception
        `wrappedException` - actual exception

    - #### JSException

          @Deprecated
          public JSException(java.lang.String s,
                                          java.lang.String filename,
                                          int lineno,
                                          java.lang.String source,
                                          int tokenIndex)

      Deprecated. Not for public use in future versions.
      Constructs a JSException with a detail message and all the other info that usually comes with a JavaScript error.
      Parameters:
        `s` - the detail message
        `filename` - source file where exception raised
        `lineno` - line where exception raised
        `source` - source text of exception
        `tokenIndex` - index on line where exception raised

  - ### Method Detail

    - #### getWrappedExceptionType

          public int getWrappedExceptionType()

      Instance method getWrappedExceptionType returns the int mapping of the type of the wrappedException Object.
      Returns:
        type of exception

    - #### getWrappedException

          public java.lang.Object getWrappedException()

      Instance method getWrappedException.
      Returns:
        actual exception

Submit a bug or feature