Add TorException base class and add a few comments.
MODIFY
WalletWasabi/Tor/Socks5/Exceptions/TorConnectCommandFailedException.cs
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.
+ /// Thrown when Tor SOCKS5 responds with an error code to previously sent <see cref="CmdField.Connect"/> command.
/// </summary>
- public class TorConnectCommandFailedException : Exception
+ public class TorConnectCommandFailedException : TorException
{
public TorConnectCommandFailedException(RepField rep) : base($"Tor SOCKS5 proxy responded with {rep}.")
{

MODIFY
WalletWasabi/Tor/Socks5/Exceptions/TorConnectionException.cs
WalletWasabi/Tor/Socks5/Exceptions/TorConnectionException.cs
@@ -2,7 +2,15 @@ using System;
namespace WalletWasabi.Tor.Socks5.Exceptions
{
- public class TorConnectionException : Exception
+ /// <summary>
+ /// Exception for the following cases:
+ /// <list type="bullet">
+ /// <item>An error in establishing a TCP connection to Tor SOCKS5 endpoint.</item>
+ /// <item>Any failure in sending data to Tor SOCKS5 endpoint.</item>
+ /// <item>Any failure in reading data from Tor SOCKS5 endpoint.</item>
+ /// </list>
+ /// </summary>
+ public class TorConnectionException : TorException
{
public TorConnectionException(string message) : base(message)
{

ADD
WalletWasabi/Tor/Socks5/Exceptions/TorException.cs
+using System;
+
+namespace WalletWasabi.Tor.Socks5.Exceptions
+{
+ /// <summary>
+ /// A base class for exceptions thrown by the Tor SOCKS5 classes.
+ /// </summary>
+ /// <remarks>This exception is abstract because it is not supposed to be instantiated.</remarks>
+ public abstract class TorException : Exception
+ {
+ public TorException(string message) : base(message)
+ {
+ }
+
+ public TorException(string message, Exception innerException) : base(message, innerException)
+ {
+ }
+ }
+}

Add TorException base class and add a few comments.

Signed-off-by: Kiminuo <kiminuo@protonmail.com>