org.mozilla.javascript

Class EcmaError


public class EcmaError
extends RuntimeException

The class of exceptions raised by the engine as described in ECMA edition 3. See section 15.11.6 in particular.

Constructor Summary

EcmaError(Scriptable nativeError, String sourceName, int lineNumber, int columnNumber, String lineSource)
Deprecated. EcmaError error instances should not be constructed explicitly since they are generated by the engine.

Method Summary

int
getColumnNumber()
The column number of the location of the error, or zero if unknown.
Scriptable
getErrorObject()
Deprecated. Always returns result of Context.getUndefinedValue().
int
getLineNumber()
Returns the line number of the statement causing the error, or zero if not available.
String
getLineSource()
The source of the line causing the error, or zero if unknown.
String
getMessage()
Gets the message corresponding to the error.
String
getName()
Gets the name of the error.
String
getSourceName()
Get the name of the source containing the error, or null if that information is not available.
String
toString()
Return a string representation of the error, which currently consists of the name of the error together with the message.

Constructor Details

EcmaError

public EcmaError(Scriptable nativeError,
                 String sourceName,
                 int lineNumber,
                 int columnNumber,
                 String lineSource)

Deprecated. EcmaError error instances should not be constructed explicitly since they are generated by the engine.

Method Details

getColumnNumber

public int getColumnNumber()
The column number of the location of the error, or zero if unknown.


getErrorObject

public Scriptable getErrorObject()

Deprecated. Always returns result of Context.getUndefinedValue().


getLineNumber

public int getLineNumber()
Returns the line number of the statement causing the error, or zero if not available.


getLineSource

public String getLineSource()
The source of the line causing the error, or zero if unknown.


getMessage

public String getMessage()
Gets the message corresponding to the error. See ECMA edition 3, 15.11.7.10.

Returns:
an implemenation-defined string describing the error.


getName

public String getName()
Gets the name of the error. ECMA edition 3 defines the following errors: EvalError, RangeError, ReferenceError, SyntaxError, TypeError, and URIError. Additional error names may be added in the future. See ECMA edition 3, 15.11.7.9.

Returns:
the name of the error.


getSourceName

public String getSourceName()
Get the name of the source containing the error, or null if that information is not available.


toString

public String toString()
Return a string representation of the error, which currently consists of the name of the error together with the message.