增加异常捕获

This commit is contained in:
陈国伟 2022-02-15 13:27:10 +08:00
parent 9c1ad66dda
commit 519c4d8e80

View File

@ -68,10 +68,17 @@ namespace FastGithub
{ {
if (OperatingSystem.IsWindows() == false) if (OperatingSystem.IsWindows() == false)
{ {
if (await this.UseFastGithubProxyAsync() == false) try
{ {
var httpProxyPort = this.fastGithubOptions.Value.HttpProxyPort; if (await this.UseFastGithubProxyAsync() == false)
this.logger.LogWarning($"请设置系统自动代理为http://{IPAddress.Loopback}:{httpProxyPort}或手动代理http/https为{IPAddress.Loopback}:{httpProxyPort}"); {
var httpProxyPort = this.fastGithubOptions.Value.HttpProxyPort;
this.logger.LogWarning($"请设置系统自动代理为http://{IPAddress.Loopback}:{httpProxyPort}或手动代理http/https为{IPAddress.Loopback}:{httpProxyPort}");
}
}
catch (Exception)
{
this.logger.LogWarning("尝试获取代理信息失败");
} }
} }
} }