foxcord/Foxcord/Rest/DiscordRestError.cs
2024-09-03 00:07:12 +02:00

22 lines
No EOL
506 B
C#

using System.Net.Http.Headers;
namespace Foxcord.Rest;
public class DiscordRestError : Exception
{
public required DiscordErrorCode Code { get; init; }
public new required string Message { get; init; }
}
public enum DiscordErrorCode
{
GeneralError = 0,
UnknownAccount = 10001,
}
public class DiscordRequestError(string message) : Exception(message);
public class RateLimitError(HttpHeaders headers) : Exception("Rate limit error")
{
public HttpHeaders Headers { get; } = headers;
}