Class Error.NotFound
- Namespace
- Trellis
- Assembly
- Trellis.Core.dll
The requested resource does not exist.
public sealed record Error.NotFound : Error, IEquatable<Error>, IEquatable<Error.NotFound>
- Inheritance
-
Error.NotFound
- Implements
- Inherited Members
- Extension Methods
Constructors
NotFound(ResourceRef)
The requested resource does not exist.
public NotFound(ResourceRef Resource)
Parameters
ResourceResourceRefThe resource that was looked up.
Properties
Kind
Gets the stable domain slug for this case (e.g. "not-found",
"invalid-input"). Suitable for telemetry, observability dimensions, and as
the durable identifier that boundary layers translate into transport-specific
type identifiers.
public override string Kind { get; }
Property Value
Resource
The resource that was looked up.
public ResourceRef Resource { get; init; }
Property Value
Methods
For(string?, ResourceRef, string?)
Convenience factory that builds a Error.NotFound from an explicit resource reference.
public static Error.NotFound For(string? code, ResourceRef resource, string? detail = null)
Parameters
codestringOptional stable reason code naming why the resource is absent. Omitted, empty, or whitespace leaves the inherited Unspecified sentinel.
resourceResourceRefThe addressed resource.
detailstringOptional human-readable detail.
Returns
- Error.NotFound
A Error.NotFound wrapping the resource reference.
For(ResourceRef, string?)
Creates a not-found error without a finer reason code.
public static Error.NotFound For(ResourceRef resource, string? detail = null)
Parameters
resourceResourceRefThe addressed resource.
detailstringOptional human-readable detail.
Returns
- Error.NotFound
A Error.NotFound with the unspecified code.
For<TResource>(string?, object?, string?)
Convenience factory that builds a Error.NotFound for the resource type
TResource (its CLR name becomes the resource name).
public static Error.NotFound For<TResource>(string? code = null, object? id = null, string? detail = null)
Parameters
codestringOptional stable reason code naming why the resource is absent — e.g.
"order.not-found"(no such row) versus"order.archived"(deliberately withheld), which share the 404 surface but are not the same answer to a client. Omitted, empty, or whitespace leaves the inherited Unspecified sentinel, so an empty string never reaches the wire.idobjectOptional identifier of the specific instance; omit for a collection-level lookup.
detailstringOptional human-readable detail.
Returns
- Error.NotFound
A Error.NotFound wrapping the resource reference.
Type Parameters
TResourceThe resource type whose name identifies the resource.