Package io.karatelabs.js
Class EngineException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
io.karatelabs.js.EngineException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
EngineInterruptedException
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionEngineException(String message, Throwable cause) EngineException(String message, Throwable cause, String jsErrorName) EngineException(String message, Throwable cause, String jsErrorName, String jsMessage) -
Method Summary
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
EngineException
-
EngineException
- Parameters:
jsErrorName- canonical JS error constructor name ("TypeError" | "ReferenceError" | "RangeError" | "SyntaxError" | "URIError" | "EvalError" | "Error" | null if non-JS origin)
-
EngineException
- Parameters:
jsErrorName- canonical JS error constructor name (see above)jsMessage- the raw JS-side.messagevalue — whate.messageinside a JScatchwould observe. Distinct fromThrowable.getMessage(), which carries the host-facing"js failed: / Code: / Error: ..."frame for logs. Passnullwhen no JS-origin message is available.
-
-
Method Details
-
getJsErrorName
- Returns:
- the JS error constructor name when this exception originated from
an uncaught JS
throw;nullfor Java-origin errors (the caller can still inspectThrowable.getMessage()or the cause chain).
-
getJsMessage
- Returns:
- the unframed JS-side message (what
e.messagewould be inside a JScatch), ornullwhen the exception has no JS-origin message. Callers building a JS-facing surface should prefer this overThrowable.getMessage(), which intentionally carries host-side framing (file/line/column) for logging.
-