Package dev.agenor.core.knowledge
Class EmbeddingException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
dev.agenor.core.exceptions.AgenorException
dev.agenor.core.knowledge.EmbeddingException
- All Implemented Interfaces:
Serializable
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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumClassifies the root cause of an embedding failure. -
Constructor Summary
ConstructorsConstructorDescriptionEmbeddingException(String message, EmbeddingException.ErrorType errorType) Constructs a newEmbeddingExceptionwithout a cause.EmbeddingException(String message, EmbeddingException.ErrorType errorType, Throwable cause) Constructs a newEmbeddingExceptionwrapping an underlying cause. -
Method Summary
Modifier and TypeMethodDescriptionReturns the error classification that allows provider-independent handling.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
EmbeddingException
Constructs a newEmbeddingExceptionwithout a cause.- Parameters:
message- human-readable error descriptionerrorType- classification of the error
-
EmbeddingException
Constructs a newEmbeddingExceptionwrapping an underlying cause.- Parameters:
message- human-readable error descriptionerrorType- classification of the errorcause- underlying exception
-
-
Method Details
-
getErrorType
Returns the error classification that allows provider-independent handling.- Returns:
- non-null
EmbeddingException.ErrorType
-