Class ScriptExecutionException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
ai.nervemind.app.executor.script.ScriptExecutionException
- All Implemented Interfaces:
Serializable
Exception thrown when script execution fails.
This exception wraps errors from various script engines (GraalJS, GraalPy, external Python) with additional context about the failure.
/** Exception thrown when script execution fails.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionScriptExecutionException(String message, String language) Create a new script execution exception.ScriptExecutionException(String message, Throwable cause, String language) Create a new script execution exception with cause.ScriptExecutionException(String message, Throwable cause, String language, String code, Integer lineNumber) Create a new script execution exception with full context. -
Method Summary
Modifier and TypeMethodDescriptiongetCode()Get the script code that failed.Get a formatted error message with context.Get the script language.Get the line number where the error occurred.Methods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
ScriptExecutionException
-
ScriptExecutionException
-
ScriptExecutionException
public ScriptExecutionException(String message, Throwable cause, String language, String code, Integer lineNumber) Create a new script execution exception with full context.- Parameters:
message- error messagecause- the underlying exceptionlanguage- the script languagecode- the script code that failedlineNumber- the line number where the error occurred (may be null)
-
-
Method Details
-
getLanguage
-
getCode
Get the script code that failed.- Returns:
- the code, or null if not available
-
getLineNumber
Get the line number where the error occurred.- Returns:
- line number, or null if not available
-
getDetailedMessage
Get a formatted error message with context.- Returns:
- detailed error message
-