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
httpCode
HttpStatusCodeThe HTTP status code returned.
request
IRequestThe request that was sent prior to the exception.
discordCode
DiscordErrorCode?The Discord status code returned.
reason
stringThe reason behind the exception.
errors
DiscordJsonError[]
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; }