foxcord/Foxcord/Rest/DiscordRestError.cs

22 lines
506 B
C#
Raw Normal View History

2024-09-03 00:07:12 +02:00
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;
}