mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
feat: log full Discord error body
This commit is contained in:
parent
efaf814e12
commit
b6a160caef
1 changed files with 3 additions and 0 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue