I have spent more time today cleaning up garbage than coding new shit, and I am mad (#31246)

* Fix logging of GetWebhook errors

Yeah let's just not log the error only stack trace.

* I have spent more time today cleaning up garbage than coding new shit, and I am mad

Cleans up the custom vote Discord webhook code because I *happened* to lay my eyes on how completely terrible it was and immediately found an obvious bug with it.

Also did basic QA because jesus christ: it more clearly reports pending votes, properly indicates cancelled votes, improves footer formatting, better error logging, all the usual shit.

Requires https://github.com/space-wizards/RobustToolbox/pull/5375 to avoid test failures
This commit is contained in:
Pieter-Jan Briers
2024-09-06 12:00:57 +02:00
committed by GitHub
parent 73520b011b
commit 582a644c24
4 changed files with 168 additions and 86 deletions

View File

@@ -33,9 +33,9 @@ public sealed class DiscordWebhook : IPostInjectInit
{
return await _http.GetFromJsonAsync<WebhookData>(url);
}
catch
catch (Exception e)
{
_sawmill.Error($"Error getting discord webhook data. Stack trace:\n{Environment.StackTrace}");
_sawmill.Error($"Error getting discord webhook data.\n{e}");
return null;
}
}