22 lines
506 B
C#
22 lines
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;
|
||
|
}
|