Class Error

Namespace
REslava.Result
Assembly
REslava.Result.dll
public class Error : Reason<Error>, IReasonMetadata, IError, IReason, IErrorFactory<Error>
Inheritance
Error
Implements
Inherited Members
Extension Methods

Constructors

Error(string, ImmutableDictionary<string, object>)

protected Error(string message, ImmutableDictionary<string, object> tags)

Parameters

message string
tags ImmutableDictionary<string, object>

Error(string, string?, string?, int)

Creates an error reason with a specific message.

public Error(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 Error with the given message.

public static Error Create(string message)

Parameters

message string

Returns

Error

CreateNew(string, ImmutableDictionary<string, object>)

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

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

Parameters

message string
tags ImmutableDictionary<string, object>

Returns

Error

WithTags(params (string key, object value)[])

Creates a new error with additional tags. Error tags must not be null to ensure proper error tracking.

public Error WithTags(params (string key, object value)[] tags)

Parameters

tags (string key, object value)[]

The tags to add to the error.

Returns

Error

A new error instance with the added tags.