Class GenkitException

All Implemented Interfaces:
Serializable
Direct Known Subclasses:
SessionContext.SessionException

public class GenkitException extends RuntimeException
GenkitException is the base exception for all Genkit errors. It provides structured error information including error codes and details.
See Also:
  • Constructor Details

    • GenkitException

      public GenkitException(String message)
      Creates a new GenkitException.
      Parameters:
      message - the error message
    • GenkitException

      public GenkitException(String message, Throwable cause)
      Creates a new GenkitException with a cause.
      Parameters:
      message - the error message
      cause - the underlying cause
    • GenkitException

      public GenkitException(String message, Throwable cause, String errorCode, Object details, String traceId)
      Creates a new GenkitException with full details.
      Parameters:
      message - the error message
      cause - the underlying cause
      errorCode - the error code
      details - additional error details
      traceId - the trace ID for debugging
  • Method Details

    • getErrorCode

      public String getErrorCode()
      Returns the error code.
      Returns:
      the error code, or null if not set
    • getDetails

      public Object getDetails()
      Returns additional error details.
      Returns:
      the error details, or null if not set
    • getTraceId

      public String getTraceId()
      Returns the trace ID for this error.
      Returns:
      the trace ID, or null if not set
    • builder

      public static GenkitException.Builder builder()
      Creates a builder for GenkitException.
      Returns:
      a new builder