Class FaultMessage
- Namespace
- AnyProtocol.Abstraction
- Assembly
- AnyProtocol.Abstraction.dll
Contains a serialized fault returned to a AnyProtocol caller.
public sealed record FaultMessage : IEquatable<FaultMessage>
- Inheritance
-
FaultMessage
- Implements
- Inherited Members
Constructors
FaultMessage(string, string, string?, bool, IReadOnlyList<FaultDetail>?)
Contains a serialized fault returned to a AnyProtocol caller.
public FaultMessage(string Code, string Message, string? ExceptionType = null, bool Retryable = false, IReadOnlyList<FaultDetail>? Details = null)
Parameters
CodestringThe machine-readable code.
MessagestringThe message payload or description.
ExceptionTypestringThe optional runtime exception type.
Retryablebooltrue if the caller may safely retry the operation; otherwise, false.
DetailsIReadOnlyList<FaultDetail>Optional structured details that further describe the result.
Properties
Code
The machine-readable code.
public string Code { get; init; }
Property Value
Details
Optional structured details that further describe the result.
public IReadOnlyList<FaultDetail>? Details { get; init; }
Property Value
ExceptionType
The optional runtime exception type.
public string? ExceptionType { get; init; }
Property Value
Message
The message payload or description.
public string Message { get; init; }
Property Value
Retryable
true if the caller may safely retry the operation; otherwise, false.
public bool Retryable { get; init; }
Property Value
Methods
Deconstruct(out string, out string, out string?, out bool, out IReadOnlyList<FaultDetail>?)
public void Deconstruct(out string Code, out string Message, out string? ExceptionType, out bool Retryable, out IReadOnlyList<FaultDetail>? Details)
Parameters
CodestringMessagestringExceptionTypestringRetryableboolDetailsIReadOnlyList<FaultDetail>
Equals(FaultMessage?)
public bool Equals(FaultMessage? other)
Parameters
otherFaultMessage
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
objobject
Returns
GetHashCode()
public override int GetHashCode()
Returns
ToString()
public override string ToString()
Returns
Operators
operator ==(FaultMessage?, FaultMessage?)
public static bool operator ==(FaultMessage? left, FaultMessage? right)
Parameters
leftFaultMessagerightFaultMessage
Returns
operator !=(FaultMessage?, FaultMessage?)
public static bool operator !=(FaultMessage? left, FaultMessage? right)
Parameters
leftFaultMessagerightFaultMessage