java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.agentforge4j.llm.api.LlmInvocationException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
FakeResponseNotFoundException
Thrown when an LLM request fails due to network issues, HTTP errors, invalid responses, or provider-specific
validation failures.
Not final: providers may define specific subtypes (for example a scripted provider's
"no response for this key" failure) so callers can catch the provider-neutral type while still distinguishing the
cause. A subtype with no HTTP status is treated as non-transient by consumers that implement retry logic.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionLlmInvocationException(String message) Creates a new exception with the given message.LlmInvocationException(String message, int httpStatus) Creates a new exception with the given message and HTTP status from the provider response.LlmInvocationException(String message, Throwable cause) Creates a new exception with the given message and cause. -
Method Summary
Modifier and TypeMethodDescriptionReturns the HTTP status code associated with this exception, if applicable.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
LlmInvocationException
Creates a new exception with the given message.- Parameters:
message- a description of the failure
-
LlmInvocationException
Creates a new exception with the given message and cause.- Parameters:
message- a description of the failurecause- the underlying exception
-
LlmInvocationException
Creates a new exception with the given message and HTTP status from the provider response.- Parameters:
message- a description of the failurehttpStatus- HTTP status code when the failure was triggered by an HTTP response
-
-
Method Details
-
getHttpStatus
Returns the HTTP status code associated with this exception, if applicable.- Returns:
- the HTTP status code, or null if not applicable
-