Table of Contents

Class PreconditionRequiredError

Namespace
Trellis
Assembly
Trellis.Results.dll

Represents a precondition required error per RFC 6585 §3. The server requires the request to be conditional — the client must include a precondition header (e.g., If-Match) to proceed. Maps to HTTP 428 Precondition Required.

public sealed class PreconditionRequiredError : Error, IEquatable<Error>
Inheritance
PreconditionRequiredError
Implements
Inherited Members
Extension Methods

Examples

Error.PreconditionRequired("This operation requires an If-Match header.")

Remarks

This error is returned when a mutating operation (PUT, PATCH, DELETE) is attempted without an If-Match header. Requiring conditional requests prevents the "lost update" problem where a client overwrites changes made by another client.

This is distinct from PreconditionFailedError (412), which indicates that a precondition WAS provided but evaluated to false.

Constructors

PreconditionRequiredError(string, string, string?)

Initializes a new instance of the PreconditionRequiredError class.

public PreconditionRequiredError(string detail, string code, string? instance = null)

Parameters

detail string

Description of what precondition is required.

code string

The error code identifying this type of error.

instance string

Optional identifier for the affected resource.