@Exported public abstract class NashornException extends RuntimeException
| Modifier | Constructor | Description |
|---|---|---|
protected |
NashornException(String msg,
String fileName,
int line,
int column) |
Constructor to initialize error message, file name, line and column numbers.
|
protected |
NashornException(String msg,
Throwable cause) |
Constructor to initialize error message and cause exception.
|
protected |
NashornException(String msg,
Throwable cause,
String fileName,
int line,
int column) |
Constructor to initialize error message, cause exception, file name, line and column numbers.
|
| Modifier and Type | Method | 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, toStringprotected 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()
NashornExceptionpublic final void setFileName(String fileName)
NashornExceptionfileName - the file namepublic final int getLineNumber()
NashornExceptionpublic final void setLineNumber(int line)
NashornExceptionline - the line numberpublic final int getColumnNumber()
NashornExceptionpublic final void setColumnNumber(int column)
NashornExceptioncolumn - 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, 2025, Oracle and/or its affiliates. All rights reserved.