Skip to content
Tracon

TraconStructuredResponseException

Namespace Tracon · Assembly Tracon.Abstractions.dll

Thrown when a run’s response fails structured output validation.

public sealed class TraconStructuredResponseException : TraconException, ISerializable

objectExceptionTraconExceptionTraconStructuredResponseException

ISerializable

TraconException.ErrorType, Exception.GetBaseException(), Exception.ToString(), Exception.GetType(), Exception.TargetSite, Exception.Message, Exception.Data, Exception.InnerException, Exception.HelpLink, Exception.Source, Exception.HResult, Exception.StackTrace, object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Thrown by the innermost IAgentDecorator in the compiled agent’s wrapper chain (Order = 30) — closest to the model call, so telemetry and run recording (the outer decorators) both see it exactly like any other run-ending error.

The message is either Tracon’s own well-formedness reason (the response was empty or not valid JSON) or the reason an IStructuredResponseValidator returned through StructuredResponseValidationResult.Invalid. Neither source ever carries the model’s raw response text.

Creates a new error.

public TraconStructuredResponseException()

TraconStructuredResponseException(string)

Section titled “ TraconStructuredResponseException(string)”

Creates a new error.

public TraconStructuredResponseException(string message)

message string

The error message. Must not carry the response text.

TraconStructuredResponseException(string, Exception)

Section titled “ TraconStructuredResponseException(string, Exception)”

Creates a new error.

public TraconStructuredResponseException(string message, Exception innerException)

message string

The error message. Must not carry the response text.

innerException Exception

The underlying error.

The stable value written to TraconException.ErrorType.

public const string StructuredResponseInvalidErrorType = "structured_response_invalid"

string

Gets the stable error type name written to the run record.

public override string ErrorType { get; }

string

Defaults to the full name of the exception type, so today’s behaviour does not change. A derived type overrides this member when the record has to be machine readable — for example TraconContentFilteredException writes content_filtered. Reports and alert rules can rely on this stable name instead of an assembly name.

The value is written to RunError.Type and carries no secret.