Rename TorSocks5FailureResponseException to TorConnectCommandFailedException.
MODIFY
WalletWasabi/Blockchain/Transactions/TransactionFactory.cs
WalletWasabi/Blockchain/Transactions/TransactionFactory.cs
@@ -323,7 +323,7 @@ namespace WalletWasabi.Blockchain.Transactions
Logger.LogInfo($"Payjoin payment was negotiated successfully.");
}
- catch (TorSocks5FailureResponseException e)
+ catch (TorConnectCommandFailedException e)
{
if (e.Message.Contains("HostUnreachable"))
{

MODIFY
WalletWasabi/CoinJoin/Client/Clients/AliceClientBase.cs
WalletWasabi/CoinJoin/Client/Clients/AliceClientBase.cs
@@ -173,7 +173,7 @@ namespace WalletWasabi.CoinJoin.Client.Clients
{
return;
}
- catch (TorSocks5FailureResponseException) // If some Tor connection issue then it'll likely time out and take it as unconfirmed.
+ catch (TorConnectCommandFailedException) // If some Tor connection issue then it'll likely time out and take it as unconfirmed.
{
return;
}

MODIFY
WalletWasabi/Services/WasabiSynchronizer.cs
WalletWasabi/Services/WasabiSynchronizer.cs
@@ -192,7 +192,7 @@ namespace WalletWasabi.Services
HandleIfGenSocksServFail(ex);
throw;
}
- catch (TorSocks5FailureResponseException ex)
+ catch (TorConnectCommandFailedException ex)
{
TorStatus = TorStatus.Running;
BackendStatus = BackendStatus.NotConnected;

MODIFY
WalletWasabi/Tor/Http/TorHttpClient.cs
WalletWasabi/Tor/Http/TorHttpClient.cs
@@ -126,7 +126,7 @@ namespace WalletWasabi.Tor.Http
return ret2;
}
// If we get ttlexpired then wait and retry again linux often do this.
- catch (TorSocks5FailureResponseException ex2) when (ex2.RepField == RepField.TtlExpired)
+ catch (TorConnectCommandFailedException ex2) when (ex2.RepField == RepField.TtlExpired)
{
Logger.LogTrace(ex);

ADD
WalletWasabi/Tor/Socks5/Exceptions/TorConnectCommandFailedException.cs
+using System;
+using WalletWasabi.Helpers;
+using WalletWasabi.Tor.Socks5.Models.Fields.OctetFields;
+
+namespace WalletWasabi.Tor.Socks5.Exceptions
+{
+ /// <summary>
+ /// Thrown when Tor SOCKS5 responds with an error to our <see cref="CmdField.Connect"/> command.
+ /// </summary>
+ public class TorConnectCommandFailedException : Exception
+ {
+ public TorConnectCommandFailedException(RepField rep) : base($"Tor SOCKS5 proxy responded with {rep}.")
+ {
+ RepField = Guard.NotNull(nameof(rep), rep);
+ }
+
+ public RepField RepField { get; }
+ }
+}

DELETE
WalletWasabi/Tor/Socks5/Exceptions/TorSocks5FailureResponseException.cs
-using System;
-using WalletWasabi.Helpers;
-using WalletWasabi.Tor.Socks5.Models.Fields.OctetFields;
-
-namespace WalletWasabi.Tor.Socks5.Exceptions
-{
- public class TorSocks5FailureResponseException : Exception
- {
- public TorSocks5FailureResponseException(RepField rep) : base($"Tor SOCKS5 proxy responded with {rep}.")
- {
- RepField = Guard.NotNull(nameof(rep), rep);
- }
-
- public RepField RepField { get; }
- }
-}

MODIFY
WalletWasabi/Tor/Socks5/TorSocks5Client.cs
WalletWasabi/Tor/Socks5/TorSocks5Client.cs
@@ -238,7 +238,7 @@ namespace WalletWasabi.Tor.Socks5
// condition that caused a failure.
DisposeTcpClient();
Logger.LogWarning($"Connection response indicates a failure. Actual response is: '{connectionResponse.Rep}'. Request: '{host}:{port}'.");
- throw new TorSocks5FailureResponseException(connectionResponse.Rep);
+ throw new TorConnectCommandFailedException(connectionResponse.Rep);
}
// Do not check the Bnd. Address and Bnd. Port. because Tor does not seem to return any, ever. It returns zeros instead.

MODIFY
WalletWasabi/Tor/TorMonitor.cs
WalletWasabi/Tor/TorMonitor.cs
@@ -42,7 +42,7 @@ namespace WalletWasabi.Tor
if (torMisbehavedFor > CheckIfRunningAfterTorMisbehavedFor)
{
- if (TorHttpClient.LatestTorException is TorSocks5FailureResponseException torEx)
+ if (TorHttpClient.LatestTorException is TorConnectCommandFailedException torEx)
{
if (torEx.RepField == RepField.HostUnreachable)
{
@@ -54,7 +54,7 @@ namespace WalletWasabi.Tor
}
// Check if it changed in the meantime...
- if (TorHttpClient.LatestTorException is TorSocks5FailureResponseException torEx2 && torEx2.RepField == RepField.HostUnreachable)
+ if (TorHttpClient.LatestTorException is TorConnectCommandFailedException torEx2 && torEx2.RepField == RepField.HostUnreachable)
{
// Fallback here...
RequestFallbackAddressUsage = true;

Rename TorSocks5FailureResponseException to TorConnectCommandFailedException.