|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.gargoylesoftware.htmlunit.ScriptException
public class ScriptException
An exception that will be thrown if an error occurs during the processing of a script.
Constructor Summary | |
---|---|
ScriptException(HtmlPage page,
Throwable throwable)
Creates an instance. |
|
ScriptException(HtmlPage page,
Throwable throwable,
String scriptSourceCode)
Creates an instance. |
Method Summary | |
---|---|
String |
getFailingLine()
Returns the line of source that was being executed when this exception was thrown. |
int |
getFailingLineNumber()
Returns the line number of the source that was executing at the time of the exception. |
HtmlPage |
getPage()
Gets the HTML page in which the script error occurred. Caution: this page may be only partially parsed if the exception occurred in a script executed at parsing time. |
String |
getScriptSourceCode()
Returns the source code line that failed. |
void |
printScriptStackTrace(PrintWriter writer)
Prints the script stack trace. |
void |
printStackTrace()
Prints the stack trace to System.out. |
void |
printStackTrace(PrintStream stream)
Prints the stack trace. |
void |
printStackTrace(PrintWriter writer)
Prints the stack trace. |
Methods inherited from class java.lang.Throwable |
---|
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, setStackTrace, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ScriptException(HtmlPage page, Throwable throwable, String scriptSourceCode)
page
- the page in which the script causing this exception was executedthrowable
- the exception that was thrown from the script enginescriptSourceCode
- the code that was being executed when this exception
was thrown. This may be null if the exception was not caused by execution
of JavaScript.public ScriptException(HtmlPage page, Throwable throwable)
page
- the page in which the script causing this exception was executedthrowable
- the exception that was thrown from the script engineMethod Detail |
---|
public void printStackTrace()
printStackTrace
in class Throwable
public void printStackTrace(PrintWriter writer)
printStackTrace
in class Throwable
writer
- Where the stack trace will be writtenpublic void printStackTrace(PrintStream stream)
printStackTrace
in class Throwable
stream
- Where the stack trace will be writtenpublic String getScriptSourceCode()
public String getFailingLine()
public int getFailingLineNumber()
public HtmlPage getPage()
public void printScriptStackTrace(PrintWriter writer)
writer
- where the stack trace will be written
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |