Package com.tnsai.rag

Class RetrievalException

All Implemented Interfaces:
Serializable

public final class RetrievalException extends RuntimeException
Typed failure raised by the common retrieval runtime.

Cooperative caller cancellation remains represented by CancellationException; it is intentionally not wrapped as a retrieval failure. Cancellation sits outside this taxonomy entirely: it is caller intent, propagates unconditionally, and is never absorbed by a failure policy.

Every failure carries a RetrievalException.Reason, and RetrievalException.Reason.surfacesAboveFailurePolicy() decides whether an entry point may route it through @Search.onFailure. Callers must branch on that predicate rather than on the exception type, because declaration and transport faults share this one class.

Since:
0.13.0
See Also:
  • Constructor Details

    • RetrievalException

      public RetrievalException(RetrievalException.Reason reason, String message)
      Creates a retrieval failure without an underlying cause.
      Parameters:
      reason - stable failure category
      message - failure detail
    • RetrievalException

      public RetrievalException(RetrievalException.Reason reason, String message, Throwable cause)
      Creates a retrieval failure with its underlying cause.
      Parameters:
      reason - stable failure category
      message - failure detail
      cause - original failure
  • Method Details