Skip to content
Tracon

TraconContentFilteredException

Namespace Tracon · Assembly Tracon.Abstractions.dll

Thrown when a model provider cuts the response short with its safety or content filter.

public sealed class TraconContentFilteredException : TraconException, ISerializable

objectExceptionTraconExceptionTraconContentFilteredException

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()

A filtered response usually arrives empty. Treating that as “succeeded but empty” produces the hardest case to debug: the user sees a blank answer and the record holds no trace. Tracon records it as an explicit failure instead — RunError.Type becomes content_filtered.

Detection lives in a shared IChatClient decorator inside Tracon.Core, not inside the provider packages, so every provider gets the same behaviour.

Creates a new error.

public TraconContentFilteredException()

Creates a new error.

public TraconContentFilteredException(string message)

message string

The error message.

TraconContentFilteredException(string, Exception)

Section titled “ TraconContentFilteredException(string, Exception)”

Creates a new error.

public TraconContentFilteredException(string message, Exception innerException)

message string

The error message.

innerException Exception

The underlying error.

The stable value written to TraconException.ErrorType.

public const string ContentFilteredErrorType = "content_filtered"

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.

Gets the finish reason the provider reported. For example Anthropic refusal or Gemini SAFETY. Carries no secret.

public string? FinishReason { get; init; }

string?

Gets the provider that filtered the response, or null when unknown.

public string? ProviderName { get; init; }

string?