Add NotSupportedNetworkException class
MODIFY
WalletWasabi.Backend/Config.cs
WalletWasabi.Backend/Config.cs
@@ -9,6 +9,7 @@ using System.Net;
using System.Text;
using System.Threading.Tasks;
using WalletWasabi.Bases;
+using WalletWasabi.Exceptions;
using WalletWasabi.Helpers;
using WalletWasabi.Interfaces;
using WalletWasabi.JsonConverters;
@@ -67,7 +68,7 @@ namespace WalletWasabi.Backend
}
else
{
- throw new NotSupportedException($"{nameof(Network)} not supported: {Network}.");
+ throw new NotSupportedNetworkException(Network);
}
}
@@ -87,7 +88,7 @@ namespace WalletWasabi.Backend
}
else
{
- throw new NotSupportedException($"{nameof(Network)} not supported: {Network}.");
+ throw new NotSupportedNetworkException(Network);
}
}

MODIFY
WalletWasabi.Gui/Config.cs
WalletWasabi.Gui/Config.cs
@@ -8,6 +8,7 @@ using System.Net;
using System.Text;
using System.Threading.Tasks;
using WalletWasabi.Bases;
+using WalletWasabi.Exceptions;
using WalletWasabi.Gui.Models;
using WalletWasabi.Helpers;
using WalletWasabi.Interfaces;
@@ -179,7 +180,7 @@ namespace WalletWasabi.Gui
}
else
{
- throw new NotSupportedException($"{nameof(Network)} not supported: {Network}.");
+ throw new NotSupportedNetworkException(Network);
}
return _backendUri;
@@ -206,7 +207,7 @@ namespace WalletWasabi.Gui
}
else
{
- throw new NotSupportedException($"{nameof(Network)} not supported: {Network}.");
+ throw new NotSupportedNetworkException(Network);
}
return _fallbackBackendUri;
@@ -233,7 +234,7 @@ namespace WalletWasabi.Gui
}
else
{
- throw new NotSupportedException($"{nameof(Network)} not supported: {Network}.");
+ throw new NotSupportedNetworkException(Network);
}
}
@@ -273,7 +274,7 @@ namespace WalletWasabi.Gui
}
else
{
- throw new NotSupportedException($"{nameof(Network)} not supported: {Network}.");
+ throw new NotSupportedNetworkException(Network);
}
}
@@ -293,7 +294,7 @@ namespace WalletWasabi.Gui
}
else
{
- throw new NotSupportedException($"{nameof(Network)} not supported: {Network}.");
+ throw new NotSupportedNetworkException(Network);
}
}

MODIFY
WalletWasabi.Tests/IntegrationTests/P2pTests.cs
WalletWasabi.Tests/IntegrationTests/P2pTests.cs
@@ -11,6 +11,7 @@ using System.Threading;
using System.Threading.Tasks;
using WalletWasabi.Backend.Models;
using WalletWasabi.Crypto;
+using WalletWasabi.Exceptions;
using WalletWasabi.Helpers;
using WalletWasabi.KeyManagement;
using WalletWasabi.Logging;
@@ -47,7 +48,7 @@ namespace WalletWasabi.Tests.IntegrationTests
}
else
{
- throw new NotSupportedException($"{nameof(Network)} not supported: {network}.");
+ throw new NotSupportedNetworkException(network);
}
var addressManagerFolderPath = Path.Combine(Global.Instance.DataDir, "AddressManager");

ADD
WalletWasabi/Exceptions/NotSupportedNetworkException.cs
+using NBitcoin;
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace WalletWasabi.Exceptions
+{
+ public class NotSupportedNetworkException : NotSupportedException
+ {
+ public NotSupportedNetworkException(Network network)
+ : base($"{nameof(Network)} not supported: {network}.")
+ {
+ }
+ }
+}

MODIFY
WalletWasabi/Helpers/Constants.cs
WalletWasabi/Helpers/Constants.cs
@@ -2,6 +2,7 @@ using NBitcoin;
using NBitcoin.Protocol;
using System;
using WalletWasabi.Backend.Models.Responses;
+using WalletWasabi.Exceptions;
namespace WalletWasabi.Helpers
{
@@ -72,7 +73,7 @@ namespace WalletWasabi.Helpers
}
else
{
- throw new NotSupportedException($"{nameof(network)} not supported: {network}.");
+ throw new NotSupportedNetworkException(network);
}
}

MODIFY
WalletWasabi/Stores/StartingFilters.cs
WalletWasabi/Stores/StartingFilters.cs
@@ -3,6 +3,7 @@ using System;
using System.Collections.Generic;
using System.Text;
using WalletWasabi.Backend.Models;
+using WalletWasabi.Exceptions;
using WalletWasabi.Models;
namespace WalletWasabi.Stores
@@ -25,7 +26,7 @@ namespace WalletWasabi.Stores
}
else
{
- throw new NotSupportedException($"{nameof(Network)} not supported: {network}.");
+ throw new NotSupportedNetworkException(network);
}
}
@@ -45,7 +46,7 @@ namespace WalletWasabi.Stores
}
else
{
- throw new NotSupportedException($"{nameof(Network)} not supported: {network}.");
+ throw new NotSupportedNetworkException(network);
}
}
}

MODIFY
WalletWasabi/WebClients/BlockCypher/BlockCypherClient.cs
WalletWasabi/WebClients/BlockCypher/BlockCypherClient.cs
@@ -6,6 +6,7 @@ using System.Net;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
+using WalletWasabi.Exceptions;
using WalletWasabi.WebClients.BlockCypher.Models;
namespace WalletWasabi.WebClients.BlockCypher
@@ -34,7 +35,7 @@ namespace WalletWasabi.WebClients.BlockCypher
}
else
{
- throw new NotSupportedException($"{nameof(Network)} not supported: {network}.");
+ throw new NotSupportedNetworkException(network);
}
}

MODIFY
WalletWasabi/WebClients/SmartBit/SmartBitClient.cs
WalletWasabi/WebClients/SmartBit/SmartBitClient.cs
@@ -9,6 +9,7 @@ using System.Net.Http;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
+using WalletWasabi.Exceptions;
using WalletWasabi.WebClients.SmartBit.Models;
namespace WalletWasabi.WebClients.SmartBit
@@ -37,7 +38,7 @@ namespace WalletWasabi.WebClients.SmartBit
}
else
{
- throw new NotSupportedException($"{nameof(Network)} not supported: {network}.");
+ throw new NotSupportedNetworkException(network);
}
}

Add NotSupportedNetworkException class