From b6a160caefe53db0c7d7833f514afc17709be580 Mon Sep 17 00:00:00 2001 From: spiral Date: Wed, 26 Jan 2022 06:21:19 -0500 Subject: [PATCH] feat: log full Discord error body --- Myriad/Rest/BaseRestClient.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Myriad/Rest/BaseRestClient.cs b/Myriad/Rest/BaseRestClient.cs index 2242bab4..0db51a59 100644 --- a/Myriad/Rest/BaseRestClient.cs +++ b/Myriad/Rest/BaseRestClient.cs @@ -231,8 +231,11 @@ public class BaseRestClient: IAsyncDisposable var body = await response.Content.ReadAsStringAsync(); var apiError = TryParseApiError(body); if (apiError != null) + { + using var _ = LogContext.PushProperty("DiscordErrorBody", body); _logger.Warning("Discord API error: {DiscordErrorCode} {DiscordErrorMessage}", apiError.Code, apiError.Message); + } throw CreateDiscordException(response, body, apiError); }