public abstract class RhinoException extends RuntimeException
| Modifier and Type | Method and Description |
|---|---|
int |
columnNumber()
The column number of the location of the error, or zero if unknown.
|
String |
details() |
String |
getMessage() |
ScriptStackElement[] |
getScriptStack()
Get the script stack of this exception as an array of
ScriptStackElements. |
ScriptStackElement[] |
getScriptStack(int limit,
String hideFunction)
Get the script stack of this exception as an array of
ScriptStackElements. |
String |
getScriptStackTrace()
Get a string representing the script stack of this exception.
|
String |
getScriptStackTrace(FilenameFilter filter)
Deprecated.
the filter argument is ignored as we are able to recognize script stack elements
by our own. Use #getScriptStackTrace() instead.
|
String |
getScriptStackTrace(int limit,
String functionName)
Get a string representing the script stack of this exception.
|
static StackStyle |
getStackStyle()
Return the current stack style in use.
|
void |
initColumnNumber(int columnNumber)
Initialize the column number of the script statement causing the error.
|
void |
initLineNumber(int lineNumber)
Initialize the line number of the script statement causing the error.
|
void |
initLineSource(String lineSource)
Initialize the text of the source line containing the error.
|
void |
initSourceName(String sourceName)
Initialize the uri of the script source containing the error.
|
int |
lineNumber()
Returns the line number of the statement causing the error, or zero if not available.
|
String |
lineSource()
The source text of the line causing the error, or null if unknown.
|
void |
printStackTrace(PrintStream s) |
void |
printStackTrace(PrintWriter s) |
static void |
setStackStyle(StackStyle style)
Specify the stack style to use from between three different formats: "Rhino" (the default),
"Mozilla", and "V8."
|
String |
sourceName()
Get the uri of the script source containing the error, or null if that information is not
available.
|
static void |
useMozillaStackStyle(boolean flag)
Tell subclasses of
RhinoException whether to use the Mozilla/Firefox style of
rendering script stacks (functionName()@fileName:lineNumber) instead of Rhino's
own Java-inspired format ( at fileName:lineNumber (functionName)). |
static boolean |
usesMozillaStackStyle()
Returns true if subclasses of
RhinoException use the Mozilla/Firefox style of
rendering script stacks (functionName()@fileName:lineNumber) instead of Rhino's
own Java-inspired format ( at fileName:lineNumber (functionName)). |
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, setStackTrace, toStringpublic final String getMessage()
getMessage in class Throwablepublic String details()
public final String sourceName()
public final void initSourceName(String sourceName)
sourceName - the uri of the script source responsible for the error. It should not be
null.IllegalStateException - if the method is called more then once.public final int lineNumber()
public final void initLineNumber(int lineNumber)
lineNumber - the line number in the script source. It should be positive number.IllegalStateException - if the method is called more then once.public final int columnNumber()
public final void initColumnNumber(int columnNumber)
columnNumber - the column number in the script source. It should be positive number.IllegalStateException - if the method is called more then once.public final String lineSource()
public final void initLineSource(String lineSource)
lineSource - the text of the source line responsible for the error. It should not be
null.IllegalStateException - if the method is called more then once.public String getScriptStackTrace()
public String getScriptStackTrace(int limit, String functionName)
limit - the number of stack frames returnedfunctionName - the name of a function on the stack -- frames below it will be ignored@Deprecated public String getScriptStackTrace(FilenameFilter filter)
filter - ignoredpublic ScriptStackElement[] getScriptStack()
ScriptStackElements. If
optimization is enabled, this includes java stack elements whose source and method names
suggest they have been generated by the Rhino script compiler.public ScriptStackElement[] getScriptStack(int limit, String hideFunction)
ScriptStackElements. If
optimization is enabled, this includes java stack elements whose source and method names
suggest they have been generated by the Rhino script compiler.limit - the number of stack frames returned, or -1 for unlimitedhideFunction - the name of a function on the stack -- frames below it will be ignored,
or nullpublic void printStackTrace(PrintWriter s)
printStackTrace in class Throwablepublic void printStackTrace(PrintStream s)
printStackTrace in class Throwablepublic static boolean usesMozillaStackStyle()
RhinoException use the Mozilla/Firefox style of
rendering script stacks (functionName()@fileName:lineNumber) instead of Rhino's
own Java-inspired format ( at fileName:lineNumber (functionName)).ScriptStackElementpublic static void useMozillaStackStyle(boolean flag)
RhinoException whether to use the Mozilla/Firefox style of
rendering script stacks (functionName()@fileName:lineNumber) instead of Rhino's
own Java-inspired format ( at fileName:lineNumber (functionName)). Use
"setStackStyle" to select between more than just the "Mozilla" and "Rhino" formats.flag - whether to render stacks in Mozilla/Firefox styleScriptStackElementpublic static void setStackStyle(StackStyle style)
style - the style to select -- an instance of the StackStyle classStackStylepublic static StackStyle getStackStyle()
Copyright © 2025 HtmlUnit. All rights reserved.