public abstract class NashornException extends RuntimeException
Modifier | Constructor and Description |
---|---|
protected |
NashornException(String msg,
String fileName,
int line,
int column)
Constructor
|
protected |
NashornException(String msg,
Throwable cause)
Constructor
|
protected |
NashornException(String msg,
Throwable cause,
String fileName,
int line,
int column)
Constructor
|
Modifier and Type | Method and Description |
---|---|
int |
getColumnNumber()
Get the column for this
NashornException |
Object |
getEcmaError()
Return the underlying ECMA error object, if available.
|
String |
getFileName()
Get the source file name for this
NashornException |
int |
getLineNumber()
Get the line number for this
NashornException |
static StackTraceElement[] |
getScriptFrames(Throwable exception)
Returns array javascript stack frames from the given exception object.
|
static String |
getScriptStackString(Throwable exception)
Return a formatted script stack trace string with frames information separated by '\n'
|
protected Object |
getThrown()
Get the thrown object.
|
protected NashornException |
initEcmaError(jdk.nashorn.internal.runtime.ScriptObject global)
Initialization function for ECMA errors.
|
void |
setColumnNumber(int column)
Set the column for this
NashornException |
void |
setEcmaError(Object ecmaError)
Return the underlying ECMA error object, if available.
|
void |
setFileName(String fileName)
Set the source file name for this
NashornException |
void |
setLineNumber(int line)
Set the line number for this
NashornException |
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
protected NashornException(String msg, String fileName, int line, int column)
msg
- exception messagefileName
- file nameline
- line numbercolumn
- column numberprotected NashornException(String msg, Throwable cause, String fileName, int line, int column)
msg
- exception messagecause
- exception causefileName
- file nameline
- line numbercolumn
- column numberpublic final String getFileName()
NashornException
public final void setFileName(String fileName)
NashornException
fileName
- the file namepublic final int getLineNumber()
NashornException
public final void setLineNumber(int line)
NashornException
line
- the line numberpublic final int getColumnNumber()
NashornException
public final void setColumnNumber(int column)
NashornException
column
- the column numberpublic static StackTraceElement[] getScriptFrames(Throwable exception)
exception
- exception from which stack frames are retrieved and filteredpublic static String getScriptStackString(Throwable exception)
exception
- exception for which script stack string is returnedprotected Object getThrown()
protected NashornException initEcmaError(jdk.nashorn.internal.runtime.ScriptObject global)
global
- the globalpublic Object getEcmaError()
public void setEcmaError(Object ecmaError)
ecmaError
- underlying ECMA Error object's mirror or whatever was thrown
from script such as a String, Number or a Boolean.
Copyright © 2014, 2015, Oracle and/or its affiliates. All rights reserved.