Skip to content

Commit

Permalink
Make exceptions from calling update continue instead of return, remov…
Browse files Browse the repository at this point in the history
…e all tags processed even if there is not value
  • Loading branch information
GravityWolfNotAmused committed Oct 19, 2024
1 parent a2146db commit 48d1cf1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions DiscordPlayerCountBot/UpdateController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ public async Task UpdatePlayerCounts()
if (ex is OperationCanceledException canceledException)
{
Warn($"Discord host connection was closed. Resetting connection.", bot.Information.Id.ToString());
return;
continue;
}

if (ex is WebSocketException socketException)
{
Warn($"Web socket was found to be in a invalid state.", bot.Information.Id.ToString());
return;
continue;
}

Error($"Please send crash log to https://discord.gg/FPXdPjcX27.", bot.Information.Id.ToString(), ex);
Expand Down
4 changes: 2 additions & 2 deletions DiscordPlayerCountBot/ViewModels/BaseViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public string ReplaceTagsWithValues(string? format, bool useNameAsLabel, string
}

var type = GetType();
var properties = type.GetProperties().ToList();
var properties = type.GetProperties();

foreach (var property in properties)
{
Expand All @@ -41,7 +41,7 @@ public string ReplaceTagsWithValues(string? format, bool useNameAsLabel, string
continue;
}

status = status.Replace(tag, value?.ToString());
status = status.Replace(tag, value?.ToString() ?? "");
}
}

Expand Down

0 comments on commit 48d1cf1

Please sign in to comment.