feat(proxy): throw user-readable error when discord rejects a webhook username

This commit is contained in:
spiral
2022-09-29 17:52:28 +00:00
parent 3bae5344b6
commit 5196e332df
2 changed files with 32 additions and 1 deletions

View File

@@ -17,7 +17,7 @@ public class DiscordRequestException: Exception
public HttpStatusCode StatusCode => Response.StatusCode;
public int? ErrorCode => ApiError?.Code;
internal DiscordApiError? ApiError { get; init; }
public DiscordApiError? ApiError { get; init; }
public override string Message =>
(ApiError?.Message ?? Response.ReasonPhrase ?? "") + (FormError != null ? $": {FormError}" : "");