Skip to content

DefaultRunErrorClassifier

Namespace AgentPrism · Assembly AgentPrism.Core.dll

AgentPrism’s built-in error classifier.

public sealed class DefaultRunErrorClassifier : IRunErrorClassifier

objectDefaultRunErrorClassifier

IRunErrorClassifier

object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

First tries an exact match on the error’s stable identity (RunError.Type); this maps both the value written by AgentPrismException subtypes (for example: content_filtered) and the old fully-qualified type name written before that value was added (for example: AgentPrism.AgentPrismCompilationException) 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 — it is never guessed.

Called only on the error path (see IRunErrorClassifier); the patterns are written with the source generator (GeneratedRegex) so as not to allocate on the hot path.

public DefaultRunErrorClassifier()

Classifies the error. Returns RunErrorClass.Unknown if no rule matches — it does not guess.

public RunErrorClassification Classify(RunError runError)

runError RunError

The raw error to classify.

RunErrorClassification

The class and clustering fingerprint.