Add ExceptionData + InputBannedExceptionData
ADD
WalletWasabi/WabiSabi/Backend/Models/ExceptionData.cs
+namespace WalletWasabi.WabiSabi.Backend.Models;
+
+public abstract record ExceptionData
+{
+}
\ No newline at end of file

ADD
WalletWasabi/WabiSabi/Backend/Models/InputBannedExceptionData.cs
+using Newtonsoft.Json;
+
+namespace WalletWasabi.WabiSabi.Backend.Models;
+
+public record InputBannedExceptionData([JsonProperty(PropertyName = "BannedUntil")] long BannedUntil) : ExceptionData;

MODIFY
WalletWasabi/WabiSabi/Backend/Models/WabiSabiProtocolException.cs
WalletWasabi/WabiSabi/Backend/Models/WabiSabiProtocolException.cs
@@ -4,13 +4,15 @@ namespace WalletWasabi.WabiSabi.Backend.Models;
public class WabiSabiProtocolException : Exception
{
- public WabiSabiProtocolException(WabiSabiProtocolErrorCode errorCode, string? message = null, Exception? innerException = null)
+ public WabiSabiProtocolException(WabiSabiProtocolErrorCode errorCode, string? message = null, Exception? innerException = null, ExceptionData? exceptionData = null)
: base(message ?? ErrorCodeDescription(errorCode), innerException)
{
ErrorCode = errorCode;
+ ExceptionData = exceptionData;
}
public WabiSabiProtocolErrorCode ErrorCode { get; }
+ public ExceptionData? ExceptionData { get; }
private static string ErrorCodeDescription(WabiSabiProtocolErrorCode errorCode)
{

Add ExceptionData + InputBannedExceptionData