Class NotFoundError

Namespace
REslava.Result
Assembly
REslava.Result.dll

Represents a "not found" error (HTTP 404 equivalent). Use when a requested resource does not exist.

public class NotFoundError : Reason<NotFoundError>, IReasonMetadata, IError, IReason, IErrorFactory<NotFoundError>
Inheritance
NotFoundError
Implements
Inherited Members
Extension Methods

Examples

Result<User>.Fail(new NotFoundError("User", userId));
Result<Order>.Fail(new NotFoundError("Order not found"));

Constructors

NotFoundError(string, object, string?, string?, int)

public NotFoundError(string entityName, object id, string? callerMember = null, string? callerFile = null, int callerLine = 0)

Parameters

entityName string
id object
callerMember string
callerFile string
callerLine int

NotFoundError(string, string?, string?, int)

public NotFoundError(string message, string? callerMember = null, string? callerFile = null, int callerLine = 0)

Parameters

message string
callerMember string
callerFile string
callerLine int

Methods

Create(string)

Creates an instance of NotFoundError with the given message.

public static NotFoundError Create(string message)

Parameters

message string

Returns

NotFoundError

CreateNew(string, ImmutableDictionary<string, object>)

Factory method for creating new instances (maintains immutability). Must be implemented by derived classes.

protected override NotFoundError CreateNew(string message, ImmutableDictionary<string, object> tags)

Parameters

message string
tags ImmutableDictionary<string, object>

Returns

NotFoundError