Class EmbeddingException

All Implemented Interfaces:
Serializable

public class EmbeddingException extends RuntimeException
Exception thrown when embedding generation fails.

This exception is used to wrap errors from embedding model API calls, providing context about the model and provider that failed.

See Also:
  • Constructor Details

    • EmbeddingException

      public EmbeddingException(String message)
      Creates a new EmbeddingException with the given message.
      Parameters:
      message - the error message
    • EmbeddingException

      public EmbeddingException(String message, Throwable cause)
      Creates a new EmbeddingException with the given message and cause.
      Parameters:
      message - the error message
      cause - the cause of this exception
    • EmbeddingException

      public EmbeddingException(String message, String modelName, String provider)
      Creates a new EmbeddingException with the given message, model name, and provider.
      Parameters:
      message - the error message
      modelName - the name of the model that failed
      provider - the provider name (e.g., "dashscope", "openai")
    • EmbeddingException

      public EmbeddingException(String message, Throwable cause, String modelName, String provider)
      Creates a new EmbeddingException with the given message, cause, model name, and provider.
      Parameters:
      message - the error message
      cause - the cause of this exception
      modelName - the name of the model that failed
      provider - the provider name (e.g., "dashscope", "openai")
  • Method Details

    • getModelName

      public String getModelName()
      Gets the model name that failed.
      Returns:
      the model name, or null if not set
    • getProvider

      public String getProvider()
      Gets the provider name.
      Returns:
      the provider name, or null if not set