@@ -108,7 +108,7 @@ namespace FastGithub.Http
catch (OperationCanceledException)
{
cancellationToken.ThrowIfCancellationRequested();
- innerExceptions.Add(new SocketException((int)SocketError.TimedOut));
+ innerExceptions.Add(new HttpConnectTimeoutException(ipEndPoint.Address));
}
catch (Exception ex)
@@ -0,0 +1,21 @@
+using System;
+using System.Net;
+
+namespace FastGithub.Http
+{
+ /// <summary>
+ /// http连接超时异常
+ /// </summary>
+ sealed class HttpConnectTimeoutException : Exception
+ {
+ /// <param name="address">连接的ip</param>
+ public HttpConnectTimeoutException(IPAddress address)
+ : base(address.ToString())
+ }
+}