Class Error
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
messagestringtagsImmutableDictionary<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
Methods
Create(string)
Creates an instance of Error with the given message.
public static Error Create(string message)
Parameters
messagestring
Returns
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
messagestringtagsImmutableDictionary<string, object>
Returns
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
Returns
- Error
A new error instance with the added tags.