Class ContractViolationException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.tnsai.actions.contracts.ContractViolationException
All Implemented Interfaces:
Serializable

public class ContractViolationException extends RuntimeException
Thrown when a @Contract precondition, postcondition, or invariant is violated at runtime (TNS-552).

Carries the expression that failed and the kind of clause, so ActionExecutor can surface an LLM-friendly message ("precondition violated: amount > 0") that the model can act on and retry. The bindings snapshot is kept for debugging (it is transient — not part of the serialized form).

Since:
0.11.0
Author:
TnsAI Team
See Also:
  • Constructor Details

  • Method Details

    • getContractKind

      public String getContractKind()
    • getViolatedExpression

      public String getViolatedExpression()
    • getBindings

      public Map<String,Object> getBindings()