Errors
Every exception type cordless raises. All inherit from CordlessError; the HTTP ones also inherit from DiscordHTTPError and carry .status, .body, and .headers. Generated straight from the installed package. See REST API for handling patterns.
BadRequest
Section titled “BadRequest”400: the request itself was malformed, see the message for which field.
CordlessError
Section titled “CordlessError”Base exception for all cordless errors.
DiscordHTTPError
Section titled “DiscordHTTPError”Raised when Discord’s REST API returns a status cordless doesn’t retry on its own. status/body/headers carry the raw response, so a caller that needs more than the message (a header, the raw body) still has it, rather than having to parse the message string back apart.
Forbidden
Section titled “Forbidden”403: the bot lacks permission for this action.
InvalidSignatureError
Section titled “InvalidSignatureError”Raised when a request fails Discord’s Ed25519 signature verification.
MessageTooLongError
Section titled “MessageTooLongError”Raised when outgoing message content exceeds Discord’s character limit.
MissingTokenError
Section titled “MissingTokenError”Raised when a bot-token REST call has no token: nothing passed and no DISCORD_BOT_TOKEN in the environment.
NoResponseError
Section titled “NoResponseError”Raised when a handler never calls ctx.send/edit/defer nor returns a response.
NotFound
Section titled “NotFound”404: the target resource doesn’t exist, or the bot can’t see it.
PermissionDeniedError
Section titled “PermissionDeniedError”Raised by a guard function when the interaction is not permitted.
ServerError
Section titled “ServerError”5xx: Discord’s own error, generally safe to retry later.
Unauthorized
Section titled “Unauthorized”401: the bot token is missing or invalid.
UnknownButtonError
Section titled “UnknownButtonError”Raised when an interaction references a custom_id with no registered handler.
UnknownCommandError
Section titled “UnknownCommandError”Raised when an interaction references a command with no registered handler.
UnknownComponentError
Section titled “UnknownComponentError”Raised when a select menu interaction has no registered handler.
UnknownModalError
Section titled “UnknownModalError”Raised when a modal submission has no registered handler.
UnsupportedInteractionError
Section titled “UnsupportedInteractionError”Raised when an interaction type is not handled by the router.