Skip to content

Commit

Permalink
增加异常捕获
Browse files Browse the repository at this point in the history
  • Loading branch information
xljiulang committed Feb 15, 2022
1 parent 9c1ad66 commit 519c4d8
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions FastGithub/AppHostedService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,17 @@ private async Task CheckFastGithubProxyAsync(CancellationToken cancellationToken
{
if (OperatingSystem.IsWindows() == false)
{
if (await this.UseFastGithubProxyAsync() == false)
try
{
var httpProxyPort = this.fastGithubOptions.Value.HttpProxyPort;
this.logger.LogWarning($"请设置系统自动代理为http://{IPAddress.Loopback}:{httpProxyPort},或手动代理http/https为{IPAddress.Loopback}:{httpProxyPort}");
if (await this.UseFastGithubProxyAsync() == false)
{
var httpProxyPort = this.fastGithubOptions.Value.HttpProxyPort;
this.logger.LogWarning($"请设置系统自动代理为http://{IPAddress.Loopback}:{httpProxyPort},或手动代理http/https为{IPAddress.Loopback}:{httpProxyPort}");
}
}
catch (Exception)
{
this.logger.LogWarning("尝试获取代理信息失败");
}
}
}
Expand Down

0 comments on commit 519c4d8

Please sign in to comment.