Class EmbeddingException

All Implemented Interfaces:
Serializable

public class EmbeddingException extends AgenorException
Typed exception thrown by EmbeddingProvider implementations.

Mirrors the structure of LLMException. The EmbeddingException.ErrorType enum allows callers to apply provider-independent error-handling strategies (e.g. exponential back-off on EmbeddingException.ErrorType.RATE_LIMIT).

Example:


 provider.embed(text).exceptionally(ex -> {
     if (ex.getCause() instanceof EmbeddingException e) {
         if (e.getErrorType() == EmbeddingException.ErrorType.RATE_LIMIT) {
             // schedule retry with back-off
         }
     }
     return null;
 });
 
See Also:
  • Constructor Details

    • EmbeddingException

      public EmbeddingException(String message, EmbeddingException.ErrorType errorType)
      Constructs a new EmbeddingException without a cause.
      Parameters:
      message - human-readable error description
      errorType - classification of the error
    • EmbeddingException

      public EmbeddingException(String message, EmbeddingException.ErrorType errorType, Throwable cause)
      Constructs a new EmbeddingException wrapping an underlying cause.
      Parameters:
      message - human-readable error description
      errorType - classification of the error
      cause - underlying exception
  • Method Details