# DefaultRunErrorClassifier

> Tracon documentation. Tracon is a .NET package family that adds a control
> plane on Microsoft Agent Framework, published as NuGet packages that run
> inside your own ASP.NET Core application.
>
> Page: https://tracon.dev/api/tracon.defaultrunerrorclassifier/
> Summary: DefaultRunErrorClassifier: Tracon's built-in error classifier.

<div class="api-provenance">Namespace Tracon · Assembly <code>Tracon.Core.dll</code></div>

Tracon's built-in error classifier.

```csharp
public sealed class DefaultRunErrorClassifier : IRunErrorClassifier
```

<dl class="api-relations"><dt>Inheritance</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object">object</a> ← <a href="/api/tracon.defaultrunerrorclassifier/">DefaultRunErrorClassifier</a></dd><dt>Implements</dt><dd><a href="/api/tracon.irunerrorclassifier/">IRunErrorClassifier</a></dd><dt>Inherited Members</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object.gettype">object.GetType()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.tostring">object.ToString()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)">object.Equals(object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)">object.Equals(object?, object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.referenceequals">object.ReferenceEquals(object?, object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.gethashcode">object.GetHashCode()</a></dd></dl>

## Remarks

First tries an exact match on the error's **stable identity**
([RunError.Type](/api/tracon.runerror/#Tracon_RunError_Type)); this maps both the value written by
[TraconException](/api/tracon.traconexception/) subtypes (for example: `content_filtered`)
and the old fully-qualified type name written before that value was added
(for example: `Tracon.TraconCompilationException`) to the SAME
class — past records join the new taxonomy without breaking.

If there is no exact match, it falls back to pattern matching on the
message and the type name. An error that matches no rule becomes
[RunErrorClass.Unknown](/api/tracon.runerrorclass/) — it is **never guessed**.

Called only on the error path (see [IRunErrorClassifier](/api/tracon.irunerrorclassifier/)); the
patterns are written with the source generator (`GeneratedRegex`) so
as not to allocate on the hot path.

Public, and safe to construct directly: it carries no dependencies, so a
consumer's own [IRunErrorClassifier](/api/tracon.irunerrorclassifier/) can compose it — try an
SDK-specific rule first, then fall back to
`builtIn.Classify(runError)` — without going through DI.

## Constructors

### <a id="Tracon_DefaultRunErrorClassifier__ctor"></a> DefaultRunErrorClassifier\(\)

Creates a new instance of Tracon's built-in error classifier.

```csharp
public DefaultRunErrorClassifier()
```

## Methods

### <a id="Tracon_DefaultRunErrorClassifier_Classify_Tracon_RunError_"></a> Classify\(RunError\)

Classifies the error. Returns [RunErrorClass.Unknown](/api/tracon.runerrorclass/) if no
rule matches — it **does not guess**.

```csharp
public RunErrorClassification Classify(RunError runError)
```

#### Parameters

`runError` [RunError](/api/tracon.runerror/)

The raw error to classify.

#### Returns

 [RunErrorClassification](/api/tracon.runerrorclassification/)

The class and clustering fingerprint.
