Class ConflictError
- Namespace
- FunctionalDdd
- Assembly
- FunctionalDdd.RailwayOrientedProgramming.dll
Represents a conflict error indicating the request conflicts with the current state of the resource. Use this when an operation cannot be completed due to a conflict with existing data or state. Maps to HTTP 409 Conflict.
public sealed class ConflictError : Error, IEquatable<Error>
- Inheritance
-
ConflictError
- Implements
- Inherited Members
- Extension Methods
Examples
Error.Conflict("Email address already in use")
Error.Conflict("Cannot delete user with active subscriptions")
Error.Conflict("Resource has been modified by another user")
Error.Conflict("Product SKU already exists in catalog")
Remarks
Common scenarios include: - Duplicate keys or unique constraint violations - Concurrent modification conflicts (optimistic locking) - State-based conflicts (e.g., cannot delete a resource that has dependencies)
This is distinct from validation errors (field-level) and domain errors (business rules). Conflicts are typically state-based and may be resolved by the client with different input or timing.
Constructors
ConflictError(string, string, string?)
Initializes a new instance of the ConflictError class.
public ConflictError(string detail, string code, string? instance = null)