Add JsonConstructor
MODIFY
WalletWasabi/Models/SerializableException.cs
WalletWasabi/Models/SerializableException.cs
@@ -7,8 +7,13 @@ namespace WalletWasabi.Models
[JsonObject(MemberSerialization.OptIn)]
public record SerializableException
{
- public SerializableException()
+ [JsonConstructor]
+ protected SerializableException(string exceptionType, string message, string stackTrace, SerializableException innerException)
{
+ ExceptionType = exceptionType;
+ Message = message;
+ StackTrace = stackTrace;
+ InnerException = innerException;
}
public SerializableException(Exception ex)
@@ -25,16 +30,16 @@ namespace WalletWasabi.Models
}
[JsonProperty(PropertyName = "ExceptionType")]
- public string? ExceptionType { get; private set; }
+ public string? ExceptionType { get; }
[JsonProperty(PropertyName = "Message")]
- public string? Message { get; private set; }
+ public string Message { get; }
[JsonProperty(PropertyName = "StackTrace")]
- public string? StackTrace { get; private set; }
+ public string? StackTrace { get; }
[JsonProperty(PropertyName = "InnerException")]
- public SerializableException? InnerException { get; private set; }
+ public SerializableException? InnerException { get; }
public static string ToBase64String(SerializableException exception)
{

Add JsonConstructor