class Discord::CodeException
- Discord::CodeException
- Discord::StatusException
- Exception
- Reference
- Object
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.crConstructors
Instance Method Summary
- #error : APIError
-
#error_code : Int32
The API error code that was returned by Discord, for example 20001 or 50016.
-
#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.
- #message
- #to_s(io)
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
Instance Method Detail
def error_code : Int32
#
The API error code that was returned by Discord, for example 20001 or 50016.
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.".