Using the ConfigurePrimaryHttpMessageHandler
/ AddPolicyHandler
retry pattern how can you perform a retry for an exception that you can't reference because of internal sealed?
Ideally I'd like to do this:
.AddPolicyHandler(HttpPolicyExtensions
.HandleTransientHttpError() //408, 5xx
.Or<SocksException>()
.WaitAndRetryAsync(3, retryAttempt => TimeSpan.FromSeconds(Math.Pow(3, retryAttempt))));
But unfortunately SocksException
looks like this:
internal sealed class SocksException : IOException
{
public SocksException(string message) : base(message) { }
public SocksException(string message, Exception innerException) : base(message, innerException) { }
}
And thus cannot be referenced directly. Will catching IOException
suffice?
Edit: I've tried by trying to catch IOException
, which you would think would work...but it doesn't. Not sure what else I could try.