Class ScriptExecutionException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
ai.nervemind.app.executor.script.ScriptExecutionException
All Implemented Interfaces:
Serializable

public class ScriptExecutionException extends RuntimeException
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 Details

    • ScriptExecutionException

      public ScriptExecutionException(String message, String language)
      Create a new script execution exception.
      Parameters:
      message - error message
      language - the script language (e.g., "javascript", "python")
    • ScriptExecutionException

      public ScriptExecutionException(String message, Throwable cause, String language)
      Create a new script execution exception with cause.
      Parameters:
      message - error message
      cause - the underlying exception
      language - the script language
    • 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 message
      cause - the underlying exception
      language - the script language
      code - the script code that failed
      lineNumber - the line number where the error occurred (may be null)
  • Method Details

    • getLanguage

      public String getLanguage()
      Get the script language.
      Returns:
      language identifier
    • getCode

      public String getCode()
      Get the script code that failed.
      Returns:
      the code, or null if not available
    • getLineNumber

      public Integer getLineNumber()
      Get the line number where the error occurred.
      Returns:
      line number, or null if not available
    • getDetailedMessage

      public String getDetailedMessage()
      Get a formatted error message with context.
      Returns:
      detailed error message