Class GraalJSException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.oracle.truffle.api.exception.AbstractTruffleException
com.oracle.truffle.js.runtime.GraalJSException
- All Implemented Interfaces:
com.oracle.truffle.api.interop.TruffleObject, Serializable
- Direct Known Subclasses:
JSException, UserScriptException
public abstract class GraalJSException
extends com.oracle.truffle.api.exception.AbstractTruffleException
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classstatic final class -
Field Summary
Fields inherited from class com.oracle.truffle.api.exception.AbstractTruffleException
UNLIMITED_STACK_TRACE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedGraalJSException(String message, com.oracle.truffle.api.nodes.Node node, int stackTraceLimit) protectedGraalJSException(String message, Throwable cause, com.oracle.truffle.api.nodes.Node node, int stackTraceLimit) protectedGraalJSException(String message, Throwable cause, com.oracle.truffle.api.source.SourceSection location, int stackTraceLimit) -
Method Summary
Modifier and TypeMethodDescriptionprotected static StringconcatErrorNameAndMessage(String name, String message) Builds the display message from the error name (required) and message (optional).protected final GraalJSExceptionfillInStackTrace(boolean capture, JSDynamicObject skipFramesUpTo, boolean customSkip) protected static <T extends GraalJSException>
TfillInStackTrace(T exception, boolean capture) protected static <T extends GraalJSException>
TfillInStackTrace(T exception, boolean capture, JSDynamicObject skipFramesUpTo, boolean customSkip) protected static StringgetErrorMessageSafe(JSObject errorObj, String message) protected static StringgetErrorNameSafe(JSObject errorObj, String name) abstract ObjectEager access to the ErrorObject.abstract ObjectCould still be null due to lazy initialization.static GraalJSException.JSStackTraceElement[]getJSStackTrace(com.oracle.truffle.api.nodes.Node originatingNode) static GraalJSException.JSStackTraceElement[]getJSStackTrace(com.oracle.truffle.api.nodes.Node originatingNode, int stackTraceLimit) final Class<? extends com.oracle.truffle.api.TruffleLanguage<?>> com.oracle.truffle.api.source.SourceSectionfinal booleanbooleanfinal intidentityHashCode(com.oracle.truffle.api.interop.InteropLibrary thisLib) voidstatic voidprintJSStackTrace(com.oracle.truffle.api.nodes.Node originatingNode) voidsetJSStackTrace(GraalJSException.JSStackTraceElement[] jsStackTrace) final ObjecttoDisplayString(boolean allowSideEffects) Methods inherited from class com.oracle.truffle.api.exception.AbstractTruffleException
fillInStackTrace, getCause, getEncapsulatingSourceSection, getLocation, getStackTraceElementLimitMethods inherited from class Throwable
addSuppressed, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
GraalJSException
-
GraalJSException
protected GraalJSException(String message, com.oracle.truffle.api.nodes.Node node, int stackTraceLimit) -
GraalJSException
-
-
Method Details
-
fillInStackTrace
protected static <T extends GraalJSException> T fillInStackTrace(T exception, boolean capture, JSDynamicObject skipFramesUpTo, boolean customSkip) -
fillInStackTrace
-
fillInStackTrace
protected final GraalJSException fillInStackTrace(boolean capture, JSDynamicObject skipFramesUpTo, boolean customSkip) -
hasSourceLocation
public boolean hasSourceLocation() -
getSourceLocationInterop
public com.oracle.truffle.api.source.SourceSection getSourceLocationInterop() throws com.oracle.truffle.api.interop.UnsupportedMessageException- Throws:
com.oracle.truffle.api.interop.UnsupportedMessageException
-
getErrorObjectLazy
Could still be null due to lazy initialization. -
getErrorObject
Eager access to the ErrorObject. Use only if you must get a non-null error object. -
getJSStackTrace
-
setJSStackTrace
-
getJSStackTrace
public static GraalJSException.JSStackTraceElement[] getJSStackTrace(com.oracle.truffle.api.nodes.Node originatingNode) -
getJSStackTrace
public static GraalJSException.JSStackTraceElement[] getJSStackTrace(com.oracle.truffle.api.nodes.Node originatingNode, int stackTraceLimit) -
printJSStackTrace
public void printJSStackTrace() -
printJSStackTrace
public static void printJSStackTrace(com.oracle.truffle.api.nodes.Node originatingNode) -
hasLanguage
public final boolean hasLanguage() -
getLanguage
-
toDisplayString
-
concatErrorNameAndMessage
-
getErrorNameSafe
-
getErrorMessageSafe
-
identityHashCode
public final int identityHashCode(com.oracle.truffle.api.interop.InteropLibrary thisLib) throws com.oracle.truffle.api.interop.UnsupportedMessageException - Throws:
com.oracle.truffle.api.interop.UnsupportedMessageException
-