## javax.script
Class ScriptException

    java.lang.Object
      java.lang.Throwable
          java.lang.Exception
              javax.script.ScriptException

All Implemented Interfaces:
  java.io.Serializable

    public class ScriptException

extends java.lang.Exception

ScriptException is a generic checked exception thrown by mehtods of scripting API. Checked exceptions thrown by the underlying interpreters must be caught and used to initialize ScriptExceptions.

Author:
  Nandika Jayawardana <nandika@opensource.lk>, Sanka Samaranayake <sanka@opensource.lk>
See Also:
  Serialized Form

Constructor Summary
`ScriptException(java.lang.Exception exception)` Constructs a new exception with the specified cause.
`ScriptException(java.lang.String message)` Constructs a new exception with the specified detailed message.
`ScriptException(java.lang.String message, java.lang.String fileName, int lineNumber)` Constructs a new exception with the spcified detailed message of cause, the file name of the source of script and the line number of the script where the error has occured.
`ScriptException(java.lang.String message, java.lang.String fileName, int lineNumber, int columnNumber)` Constructs a new exception using the detailed message of cause, file name which contains the script, line number and column number in which the error has occured.

Method Summary
`int` `getColumnNumber()` Retrieves the column number of the script where the error has occured.
`java.lang.String` `getFileName()` Retrieves the file name in which the script is contained.
`int` `getLineNumber()` Retrieves the line number of the script where the error has occured.
`java.lang.String` `getMessage()` Retrieves a String describing the cause of error.

Methods inherited from class java.lang.Throwable
`fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### ScriptException

    public ScriptException(java.lang.Exception exception)

  Constructs a new exception with the specified cause.

  Parameters:
    `exception` - the cause of exception

### ScriptException

    public ScriptException(java.lang.String message)

  Constructs a new exception with the specified detailed message.

  Parameters:
    `message` - the datailed message which caused the exception

### ScriptException

    public ScriptException(java.lang.String message,
                           java.lang.String fileName,
                           int lineNumber)

  Constructs a new exception with the spcified detailed message of cause, the file name of the source of script and the line number of the script where the error has occured.

  Parameters:
    `message` - the detailed message of cause of exception
    `fileName` - the file name which contains the script
    `lineNumber` - the line number of the script where the error has occured

### ScriptException

    public ScriptException(java.lang.String message,
                           java.lang.String fileName,
                           int lineNumber,
                           int columnNumber)

  Constructs a new exception using the detailed message of cause, file name which contains the script, line number and column number in which the error has occured.

  Parameters:
    `message` - the detailed message of the cause of exception
    `fileName` - the name of the file which contains the script
    `lineNumber` - the line number of the script where the error has occured
    `columnNumber` - the column number of the script where the error has occured

Method Detail

### getFileName

    public java.lang.String getFileName()

  Retrieves the file name in which the script is contained.

  Returns:
    Returns the file name in which the script is contained

### getColumnNumber

    public int getColumnNumber()

  Retrieves the column number of the script where the error has occured. If the information is not available, returns -1.

  Returns:
    Returns the column number of the script where the error has occured

### getLineNumber

    public int getLineNumber()

  Retrieves the line number of the script where the error has occured. If the information is not available, returns -1.

  Returns:
    Returns the line number of the script where the error has occured

### getMessage

    public java.lang.String getMessage()

  Retrieves a String describing the cause of error.

  Overrides:
    `getMessage` in class `java.lang.Throwable`
  Returns:
    a String describing the cause of error