Search Results for

    Show / Hide Table of Contents

    Class HttpException

    The exception that is thrown if an error occurs while processing an Discord HTTP request.

    Inheritance
    Object
    HttpException
    ApplicationCommandException
    Namespace: Discord.Net
    Assembly: Discord.Net.Core.dll
    Syntax
    public class HttpException : Exception

    Constructors

    | Improve this Doc View Source

    HttpException(HttpStatusCode, IRequest, Nullable<DiscordErrorCode>, String, DiscordJsonError[])

    Initializes a new instance of the HttpException class.

    Declaration
    public HttpException(HttpStatusCode httpCode, IRequest request, DiscordErrorCode? discordCode = null, string reason = null, DiscordJsonError[] errors = null)
    Parameters
    Type Name Description
    HttpStatusCode httpCode

    The HTTP status code returned.

    IRequest request

    The request that was sent prior to the exception.

    Nullable<DiscordErrorCode> discordCode

    The Discord status code returned.

    String reason

    The reason behind the exception.

    DiscordJsonError[] errors

    Properties

    | Improve this Doc View Source

    DiscordCode

    Gets the JSON error code returned by Discord.

    Declaration
    public DiscordErrorCode? DiscordCode { get; }
    Property Value
    Type Description
    Nullable<DiscordErrorCode>

    A JSON error code from Discord, or null if none.

    | Improve this Doc View Source

    Errors

    Gets a collection of json errors describing what went wrong with the request.

    Declaration
    public IReadOnlyCollection<DiscordJsonError> Errors { get; }
    Property Value
    Type Description
    IReadOnlyCollection<DiscordJsonError>
    | Improve this Doc View Source

    HttpCode

    Gets the HTTP status code returned by Discord.

    Declaration
    public HttpStatusCode HttpCode { get; }
    Property Value
    Type Description
    HttpStatusCode

    An HTTP status code from Discord.

    | Improve this Doc View Source

    Reason

    Gets the reason of the exception.

    Declaration
    public string Reason { get; }
    Property Value
    Type Description
    String
    | Improve this Doc View Source

    Request

    Gets the request object used to send the request.

    Declaration
    public IRequest Request { get; }
    Property Value
    Type Description
    IRequest

    Theme

    • Improve this Doc
    • View Source
    In This Article
    Back to top Discord.Net (c) 2015-2023 3.10.0