fix exception not being logged (#2800)

This commit is contained in:
Mihail Gribkov
2023-12-26 14:08:52 +03:00
committed by GitHub
parent d234db70a0
commit 8227d70b86

View File

@@ -648,7 +648,6 @@ namespace Discord.WebSocket
if (ConnectionState == ConnectionState.Connected) if (ConnectionState == ConnectionState.Connected)
{ {
EnsureGatewayIntent(GatewayIntents.GuildMembers); EnsureGatewayIntent(GatewayIntents.GuildMembers);
//Race condition leads to guilds being requested twice, probably okay //Race condition leads to guilds being requested twice, probably okay
return ProcessUserDownloadsAsync(guilds.Select(x => GetGuild(x.Id)).Where(x => x != null)); return ProcessUserDownloadsAsync(guilds.Select(x => GetGuild(x.Id)).Where(x => x != null));
} }
@@ -997,7 +996,14 @@ namespace Discord.WebSocket
return; return;
if (BaseConfig.AlwaysDownloadUsers) if (BaseConfig.AlwaysDownloadUsers)
_ = DownloadUsersAsync(Guilds.Where(x => x.IsAvailable && !x.HasAllMembers)); try
{
_ = DownloadUsersAsync(Guilds.Where(x => x.IsAvailable && !x.HasAllMembers));
}
catch (Exception ex)
{
await _gatewayLogger.WarningAsync(ex);
}
await TimedInvokeAsync(_readyEvent, nameof(Ready)).ConfigureAwait(false); await TimedInvokeAsync(_readyEvent, nameof(Ready)).ConfigureAwait(false);
await _gatewayLogger.InfoAsync("Ready").ConfigureAwait(false); await _gatewayLogger.InfoAsync("Ready").ConfigureAwait(false);