Class ErrorMessage
Default implementation of IErrorMessage.
[JsonTypeID("error")]
public sealed class ErrorMessage : MessageSinkMessage, IJsonDeserializable, IErrorMessage, IMessageSinkMessage, IJsonSerializable, IErrorMetadata
- Inheritance
-
ErrorMessage
- Implements
- Inherited Members
- Extension Methods
Properties
ExceptionParentIndices
Gets the parent exception index(es) for the exception(s); a -1 indicates that the exception in question has no parent.
public required int[] ExceptionParentIndices { get; set; }
Property Value
- int[]
Remarks
Note: Will be an empty array if there was no value provided during deserialization.
ExceptionTypes
Gets the fully-qualified type name(s) of the exception(s).
public required string?[] ExceptionTypes { get; set; }
Property Value
- string[]
Remarks
Note: Will be an empty array if there was no value provided during deserialization.
Messages
Gets the message(s) of the exception(s).
public required string[] Messages { get; set; }
Property Value
- string[]
Remarks
Note: Will be an empty array if there was no value provided during deserialization.
StackTraces
Gets the stack trace(s) of the exception(s).
public required string?[] StackTraces { get; set; }
Property Value
- string[]
Remarks
Note: Will be an empty array if there was no value provided during deserialization.
Methods
Deserialize(IReadOnlyDictionary<string, object?>)
Override to deserialize the values in the dictionary into the message.
protected override void Deserialize(IReadOnlyDictionary<string, object?> root)
Parameters
rootIReadOnlyDictionary<string, object>The root of the JSON object
FromException(Exception)
Creates a new IErrorMessage constructed from an Exception object.
public static IErrorMessage FromException(Exception ex)
Parameters
exExceptionThe exception to use
Returns
Serialize(JsonObjectSerializer)
Override to serialize the values in the message into JSON.
protected override void Serialize(JsonObjectSerializer serializer)
Parameters
serializerJsonObjectSerializerThe serializer to write values to.
ToString()
public override string ToString()