Class HttpException
The exception that is thrown if an error occurs while processing an Discord HTTP request.
public class HttpException : Exception, ISerializable
- Inheritance
-
HttpException
- Implements
- Derived
- Inherited Members
Constructors
HttpException(HttpStatusCode, IRequest, DiscordErrorCode?, string, DiscordJsonError[])
Initializes a new instance of the HttpException class.
public HttpException(HttpStatusCode httpCode, IRequest request, DiscordErrorCode? discordCode = null, string reason = null, DiscordJsonError[] errors = null)
Parameters
httpCodeHttpStatusCodeThe HTTP status code returned.
requestIRequestThe request that was sent prior to the exception.
discordCodeDiscordErrorCode?The Discord status code returned.
reasonstringThe reason behind the exception.
errorsDiscordJsonError[]
Properties
DiscordCode
Gets the JSON error code returned by Discord.
public DiscordErrorCode? DiscordCode { get; }
Property Value
- DiscordErrorCode?
A JSON error code from Discord, or null if none.
Errors
Gets a collection of json errors describing what went wrong with the request.
public IReadOnlyCollection<DiscordJsonError> Errors { get; }
Property Value
HttpCode
Gets the HTTP status code returned by Discord.
public HttpStatusCode HttpCode { get; }
Property Value
- HttpStatusCode
An HTTP status code from Discord.
Reason
Gets the reason of the exception.
public string Reason { get; }
Property Value
Request
Gets the request object used to send the request.
public IRequest Request { get; }