Class ProtoFailureDiagnostics

Namespace
ProtoTest.Json
Assembly
ProtoTest.Json.dll

The sanitized facts shared by every failed call in every protocol, so REST, GraphQL, gRPC and messaging redact and report a failure the same way: the address and the message pass the shared redaction rules, and cancellation is recognized from either the token or the exception type.

public sealed record ProtoFailureDiagnostics : IEquatable<ProtoFailureDiagnostics>
Inheritance
ProtoFailureDiagnostics
Implements
Inherited Members
Extension Methods

Constructors

ProtoFailureDiagnostics(string?, string, string, bool)

The sanitized facts shared by every failed call in every protocol, so REST, GraphQL, gRPC and messaging redact and report a failure the same way: the address and the message pass the shared redaction rules, and cancellation is recognized from either the token or the exception type.

public ProtoFailureDiagnostics(string? RequestUri, string ExceptionType, string Message, bool IsCanceled)

Parameters

RequestUri string
ExceptionType string
Message string
IsCanceled bool

Properties

Duration

How long the failed call ran, when the protocol measured it.

public TimeSpan? Duration { get; init; }

Property Value

TimeSpan?

ExceptionType

public string ExceptionType { get; init; }

Property Value

string

IsCanceled

public bool IsCanceled { get; init; }

Property Value

bool

Message

public string Message { get; init; }

Property Value

string

RequestUri

public string? RequestUri { get; init; }

Property Value

string

Methods

From(Uri?, Exception, CancellationToken, JsonDiagnosticOptions?, IReadOnlyCollection<string>?)

Captures a failed call. options supplies the redaction rules; sensitiveQueryParameters overrides the address redaction list, so an HTTP protocol keeps its configured SensitiveQueryParameters while gRPC and messaging use the shared defaults.

public static ProtoFailureDiagnostics From(Uri? requestUri, Exception exception, CancellationToken cancellationToken, JsonDiagnosticOptions? options = null, IReadOnlyCollection<string>? sensitiveQueryParameters = null)

Parameters

requestUri Uri
exception Exception
cancellationToken CancellationToken
options JsonDiagnosticOptions
sensitiveQueryParameters IReadOnlyCollection<string>

Returns

ProtoFailureDiagnostics