Class UncorrectableRuntimeLLMException

All Implemented Interfaces:
LLMReadable, LLMReadableException, Serializable
Direct Known Subclasses:
ModelNotFoundException, ProviderRefusalException, QuotaExhaustedException, SpendCapExceededException

public non-sealed class UncorrectableRuntimeLLMException extends LLMReadableRuntimeException
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:

Since:
0.1 (2026-03-13)
Author:
Andrey Santrosyan
See Also:
  • Constructor Details

    • UncorrectableRuntimeLLMException

      public UncorrectableRuntimeLLMException(String llmMessage)
      Constructs an uncorrectable runtime exception with the specified LLM message.
      Parameters:
      llmMessage - clean, actionable error message for LLM understanding
    • UncorrectableRuntimeLLMException

      public UncorrectableRuntimeLLMException(String llmMessage, Throwable cause)
      Constructs an uncorrectable runtime exception with the specified LLM message and cause.
      Parameters:
      llmMessage - clean, actionable error message for LLM understanding
      cause - the cause (preserved for developer debugging)
  • Method Details

    • isCorrectable

      public final boolean isCorrectable()
      Description copied from interface: LLMReadableException
      Indicates 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

      public String explainToLLM()
      Description copied from interface: LLMReadableException
      Explains 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