Skip to content

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.

400: the request itself was malformed, see the message for which field.

Base exception for all cordless errors.

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.

403: the bot lacks permission for this action.

Raised when a request fails Discord’s Ed25519 signature verification.

Raised when outgoing message content exceeds Discord’s character limit.

Raised when a bot-token REST call has no token: nothing passed and no DISCORD_BOT_TOKEN in the environment.

Raised when a handler never calls ctx.send/edit/defer nor returns a response.

404: the target resource doesn’t exist, or the bot can’t see it.

Raised by a guard function when the interaction is not permitted.

5xx: Discord’s own error, generally safe to retry later.

401: the bot token is missing or invalid.

Raised when an interaction references a custom_id with no registered handler.

Raised when an interaction references a command with no registered handler.

Raised when a select menu interaction has no registered handler.

Raised when a modal submission has no registered handler.

Raised when an interaction type is not handled by the router.