Struct MediatorError
- Namespace
- SimpleMediator
- Assembly
- SimpleMediator.dll
Minimal immutable mediator error representation with optional exception metadata.
public readonly record struct MediatorError : IEquatable<MediatorError>
- Implements
- Inherited Members
- Extension Methods
Properties
Exception
Optional exception information associated with the failure that callers may inspect.
public Option<Exception> Exception { get; }
Property Value
- Option<Exception>
Message
Human-readable description of the failure.
public string Message { get; }
Property Value
Methods
New(Exception)
Creates an error from an exception, preserving the exception message by default.
public static MediatorError New(Exception exception)
Parameters
exceptionException
Returns
New(Exception, string)
Creates an error from an exception and explicit message override.
public static MediatorError New(Exception exception, string message)
Parameters
Returns
New(string)
Creates an error from a message.
public static MediatorError New(string message)
Parameters
messagestring
Returns
New(string, Exception?)
Creates an error from a message and optional exception.
public static MediatorError New(string message, Exception? exception)
Parameters
Returns
Operators
implicit operator MediatorError(Exception)
Implicit conversion from Exception to MediatorError.
public static implicit operator MediatorError(Exception exception)
Parameters
exceptionException
Returns
implicit operator MediatorError(string)
Implicit conversion from string to MediatorError.
public static implicit operator MediatorError(string message)
Parameters
messagestring