Class UncorrectableRuntimeLLMException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
ai.redouble.nucleo.harness.errors.LLMReadableRuntimeException
ai.redouble.nucleo.harness.errors.UncorrectableRuntimeLLMException
- All Implemented Interfaces:
LLMReadable, LLMReadableException, Serializable
- Direct Known Subclasses:
ModelNotFoundException, ProviderRefusalException, QuotaExhaustedException, SpendCapExceededException
Runtime (unchecked) exception indicating the tool cannot work right now, regardless
of what the LLM sends. The LLM should try a different approach.
This is the unchecked counterpart of UncorrectableLLMException. Use when
checked exceptions are impractical but the error is uncorrectable by the LLM.
Example usage:
// In a callback where checked exceptions can't propagate
connectionPool.withConnection(conn -> {
if (conn.isClosed()) {
throw new UncorrectableRuntimeLLMException(
"Database connection unavailable - try a different approach");
}
return query(conn);
});
Subclasses:
QuotaExhaustedException- the provider account is out of moneySpendCapExceededException- admission refused the job under its workflow's spend capModelNotFoundException- the catalog holds no model under the idProviderRefusalException- the provider declined the call; typed so a caller can resubmit on another model
- Since:
- 0.1 (2026-03-13)
- Author:
- Andrey Santrosyan
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionUncorrectableRuntimeLLMException(String llmMessage) Constructs an uncorrectable runtime exception with the specified LLM message.UncorrectableRuntimeLLMException(String llmMessage, Throwable cause) Constructs an uncorrectable runtime exception with the specified LLM message and cause. -
Method Summary
Modifier and TypeMethodDescriptionExplains the error to the LLM for inclusion in the conversation context.final booleanIndicates whether the LLM may retry the same tool with different input.Methods inherited from class LLMReadableRuntimeException
getLLMMessage, unwrapRuntimeMethods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
UncorrectableRuntimeLLMException
Constructs an uncorrectable runtime exception with the specified LLM message.- Parameters:
llmMessage- clean, actionable error message for LLM understanding
-
UncorrectableRuntimeLLMException
-
-
Method Details
-
isCorrectable
public final boolean isCorrectable()Description copied from interface:LLMReadableExceptionIndicates whether the LLM may retry the same tool with different input.true (correctable): The LLM's input was wrong. It may fix its parameters and call the same tool again.
false (uncorrectable): The tool itself cannot work right now, regardless of input. The LLM should try a different approach.
- Returns:
- true if correctable, false if uncorrectable
-
explainToLLM
Description copied from interface:LLMReadableExceptionExplains the error to the LLM for inclusion in the conversation context.The default implementation returns just the LLM message. Subclasses typically append a hint indicating whether the error is correctable or not, so the LLM knows whether to retry or try a different approach.
- Returns:
- full error explanation for the LLM
-