Class OutputGuardrailException

All Implemented Interfaces:
Serializable

public final class OutputGuardrailException extends GuardrailException
Exception thrown when an output guardrail validation fails.

This class is not intended to be thrown within guardrail implementations. It is for the framework only. It is ok to catch it.

See Also:
  • Constructor Details

    • OutputGuardrailException

      public OutputGuardrailException(String message)
    • OutputGuardrailException

      public OutputGuardrailException(String message, Throwable cause)
    • OutputGuardrailException

      public OutputGuardrailException(String message, Throwable cause, OutputGuardrailResult result)
  • Method Details

    • result

      public OutputGuardrailResult result()
      Returns the OutputGuardrailResult that caused this exception, or null if not available. Callers catching this exception can inspect the result to understand which guardrail failed and whether the violating message was removed from memory.