Table of Contents

Class HttpError.PreconditionFailed

Namespace
Trellis
Assembly
Trellis.Http.Abstractions.dll

HTTP 412 — a request precondition (for example If-Match) failed.

public sealed record HttpError.PreconditionFailed : HttpError, ICodedTransportFault, ITransportFault, IEquatable<HttpError>, IEquatable<HttpError.PreconditionFailed>
Inheritance
HttpError.PreconditionFailed
Implements
Inherited Members
Extension Methods

Constructors

PreconditionFailed(ResourceRef, PreconditionKind)

HTTP 412 — a request precondition (for example If-Match) failed.

public PreconditionFailed(ResourceRef Resource, PreconditionKind Condition)

Parameters

Resource ResourceRef

The resource the precondition was evaluated against.

Condition PreconditionKind

Which precondition failed.

Properties

Code

Gets the machine-readable code for this fault. Defaults to Kind; cases whose payload identifies a specific conditional header override it.

public override string Code { get; }

Property Value

string

Condition

Which precondition failed.

public PreconditionKind Condition { get; init; }

Property Value

PreconditionKind

Kind

Gets the stable, HTTP-aligned identifier for this case (for example "method-not-allowed" or "precondition-failed").

public override string Kind { get; }

Property Value

string

Resource

The resource the precondition was evaluated against.

public ResourceRef Resource { get; init; }

Property Value

ResourceRef

Methods

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.