Add exception handling for WabiSabiCryptoException
MODIFY
WalletWasabi.Backend/Filters/ExceptionTranslateFilter.cs
WalletWasabi.Backend/Filters/ExceptionTranslateFilter.cs
@@ -4,6 +4,7 @@ using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
using WalletWasabi.WabiSabi;
using WalletWasabi.WabiSabi.Backend.Models;
+using WalletWasabi.WabiSabi.Crypto;
using WalletWasabi.WabiSabi.Models;
namespace WalletWasabi.Backend.Filters
@@ -23,6 +24,13 @@ namespace WalletWasabi.Backend.Filters
{
StatusCode = (int)HttpStatusCode.InternalServerError
},
+ WabiSabiCryptoException e => new JsonResult(new Error(
+ Type: ProtocolConstants.ProtocolViolationType,
+ ErrorCode: WabiSabiProtocolErrorCode.CryptoException.ToString(),
+ Description: e.Message))
+ {
+ StatusCode = (int)HttpStatusCode.InternalServerError
+ },
_ => new StatusCodeResult((int)HttpStatusCode.InternalServerError)
};
}

Add exception handling for WabiSabiCryptoException