Class JSException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.oracle.truffle.api.exception.AbstractTruffleException
com.oracle.truffle.js.runtime.GraalJSException
com.oracle.truffle.js.runtime.JSException
All Implemented Interfaces:
com.oracle.truffle.api.interop.TruffleObject, Serializable

public final class JSException extends GraalJSException
See Also:
  • Method Details

    • createCapture

      public static JSException createCapture(JSErrorType type, String message, JSObject exceptionObj, JSRealm realm, int stackTraceLimit, JSDynamicObject skipFramesUpTo, boolean customSkip)
    • createCapture

      public static JSException createCapture(JSErrorType type, String message, JSObject exceptionObj, JSRealm realm)
    • create

      public static JSException create(JSErrorType type, String message, JSObject exceptionObj, JSRealm realm)
    • create

      public static JSException create(JSErrorType type, String message, com.oracle.truffle.api.nodes.Node originatingNode, JSObject exceptionObj, JSRealm realm)
    • create

      public static JSException create(JSErrorType type, String message)
    • create

      public static JSException create(JSErrorType type, String message, com.oracle.truffle.api.nodes.Node originatingNode)
    • create

      public static JSException create(JSErrorType type, String message, Throwable cause, com.oracle.truffle.api.nodes.Node originatingNode)
    • create

      public static JSException create(JSErrorType type, String message, com.oracle.truffle.api.source.SourceSection sourceLocation, boolean isIncompleteSource)
    • create

      public static JSException create(JSErrorType type, String message, Throwable cause, com.oracle.truffle.api.source.SourceSection sourceLocation, boolean isIncompleteSource)
    • getStackTraceLimit

      public static int getStackTraceLimit(JSRealm realm)
    • getMessage

      public String getMessage()
      Overrides:
      getMessage in class Throwable
    • getRawMessage

      public String getRawMessage()
    • getErrorType

      public JSErrorType getErrorType()
    • getErrorObjectLazy

      public JSObject getErrorObjectLazy()
      Description copied from class: GraalJSException
      Could still be null due to lazy initialization.
      Specified by:
      getErrorObjectLazy in class GraalJSException
    • setErrorObject

      public void setErrorObject(JSObject exceptionObj)
    • getErrorObject

      public Object getErrorObject()
      Description copied from class: GraalJSException
      Eager access to the ErrorObject. Use only if you must get a non-null error object.
      Specified by:
      getErrorObject in class GraalJSException
    • getRealm

      public JSRealm getRealm()
    • getExceptionType

      public com.oracle.truffle.api.interop.ExceptionType getExceptionType()
    • isExceptionIncompleteSource

      public boolean isExceptionIncompleteSource()
    • hasMembers

      public boolean hasMembers()
    • getMembers

      public Object getMembers(boolean internal, com.oracle.truffle.api.interop.InteropLibrary delegateLib) throws com.oracle.truffle.api.interop.UnsupportedMessageException
      Throws:
      com.oracle.truffle.api.interop.UnsupportedMessageException
    • isMemberReadable

      public boolean isMemberReadable(String key, com.oracle.truffle.api.interop.InteropLibrary delegateLib)
    • isMemberModifiable

      public boolean isMemberModifiable(String key, com.oracle.truffle.api.interop.InteropLibrary delegateLib)
    • isMemberInsertable

      public boolean isMemberInsertable(String key, com.oracle.truffle.api.interop.InteropLibrary delegateLib)
    • isMemberRemovable

      public boolean isMemberRemovable(String key, com.oracle.truffle.api.interop.InteropLibrary delegateLib)
    • isMemberInvocable

      public boolean isMemberInvocable(String key, com.oracle.truffle.api.interop.InteropLibrary delegateLib)
    • hasMemberReadSideEffects

      public boolean hasMemberReadSideEffects(String key, com.oracle.truffle.api.interop.InteropLibrary delegateLib)
    • hasMemberWriteSideEffects

      public boolean hasMemberWriteSideEffects(String key, com.oracle.truffle.api.interop.InteropLibrary delegateLib)
    • readMember

      public Object readMember(String key, com.oracle.truffle.api.interop.InteropLibrary delegateLib) throws com.oracle.truffle.api.interop.UnknownIdentifierException, com.oracle.truffle.api.interop.UnsupportedMessageException
      Throws:
      com.oracle.truffle.api.interop.UnknownIdentifierException
      com.oracle.truffle.api.interop.UnsupportedMessageException
    • writeMember

      public void writeMember(String key, Object value, com.oracle.truffle.api.interop.InteropLibrary delegateLib) throws com.oracle.truffle.api.interop.UnsupportedMessageException, com.oracle.truffle.api.interop.UnknownIdentifierException, com.oracle.truffle.api.interop.UnsupportedTypeException
      Throws:
      com.oracle.truffle.api.interop.UnsupportedMessageException
      com.oracle.truffle.api.interop.UnknownIdentifierException
      com.oracle.truffle.api.interop.UnsupportedTypeException
    • removeMember

      public void removeMember(String key, com.oracle.truffle.api.interop.InteropLibrary delegateLib) throws com.oracle.truffle.api.interop.UnsupportedMessageException, com.oracle.truffle.api.interop.UnknownIdentifierException
      Throws:
      com.oracle.truffle.api.interop.UnsupportedMessageException
      com.oracle.truffle.api.interop.UnknownIdentifierException
    • invokeMember

      public Object invokeMember(String key, Object[] args, com.oracle.truffle.api.interop.InteropLibrary delegateLib) throws com.oracle.truffle.api.interop.UnsupportedMessageException, com.oracle.truffle.api.interop.UnknownIdentifierException, com.oracle.truffle.api.interop.ArityException, com.oracle.truffle.api.interop.UnsupportedTypeException
      Throws:
      com.oracle.truffle.api.interop.UnsupportedMessageException
      com.oracle.truffle.api.interop.UnknownIdentifierException
      com.oracle.truffle.api.interop.ArityException
      com.oracle.truffle.api.interop.UnsupportedTypeException
    • hasMetaObject

      public boolean hasMetaObject(com.oracle.truffle.api.interop.InteropLibrary delegateLib)
    • getMetaObject

      public Object getMetaObject(com.oracle.truffle.api.interop.InteropLibrary delegateLib) throws com.oracle.truffle.api.interop.UnsupportedMessageException
      Throws:
      com.oracle.truffle.api.interop.UnsupportedMessageException
    • ensureInitialized

      public static void ensureInitialized() throws ClassNotFoundException
      Throws:
      ClassNotFoundException