class Discord::CodeException

Overview

This exception is raised in REST#request when a request fails with an API error response that has a code and a descriptive message.

Defined in:

discordcr/errors.cr

Constructors

Instance Method Summary

Instance methods inherited from class Discord::StatusException

message message, response : HTTP::Client::Response response, status_code : Int32 status_code, status_message : String status_message, to_s(io) to_s

Constructor methods inherited from class Discord::StatusException

new(response : HTTP::Client::Response) new

Constructor Detail

def self.new(response : HTTP::Client::Response, error : APIError) #

[View source]

Instance Method Detail

def error : APIError #

[View source]
def error_code : Int32 #

The API error code that was returned by Discord, for example 20001 or 50016.


[View source]
def error_message : String #

The API error message that was returned by Discord, for example "Bots cannot use this endpoint" or "Provided too few or too many messages to delete. Must provide at least 2 and fewer than 100 messages to delete.".


[View source]
def message #

[View source]
def to_s(io) #

[View source]