feat: log full Discord error body
This commit is contained in:
parent
efaf814e12
commit
b6a160caef
@ -231,8 +231,11 @@ public class BaseRestClient: IAsyncDisposable
|
|||||||
var body = await response.Content.ReadAsStringAsync();
|
var body = await response.Content.ReadAsStringAsync();
|
||||||
var apiError = TryParseApiError(body);
|
var apiError = TryParseApiError(body);
|
||||||
if (apiError != null)
|
if (apiError != null)
|
||||||
|
{
|
||||||
|
using var _ = LogContext.PushProperty("DiscordErrorBody", body);
|
||||||
_logger.Warning("Discord API error: {DiscordErrorCode} {DiscordErrorMessage}", apiError.Code,
|
_logger.Warning("Discord API error: {DiscordErrorCode} {DiscordErrorMessage}", apiError.Code,
|
||||||
apiError.Message);
|
apiError.Message);
|
||||||
|
}
|
||||||
|
|
||||||
throw CreateDiscordException(response, body, apiError);
|
throw CreateDiscordException(response, body, apiError);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user