pub enum Error {
Show 27 variants
MalformedBody {
error_type: MalformedBodyErrorType,
message: String,
},
MissingBody {
message: String,
},
InvalidField {
field: String,
message: String,
},
MissingField {
field: String,
message: String,
},
MalformedIp {
message: String,
},
NotFound {
entity: String,
message: String,
},
GuildOnly {
message: String,
},
UnsupportedAuthMethod {
message: String,
},
InvalidToken {
message: String,
},
InvalidCredentials {
what: String,
message: String,
},
InvalidCaptcha {
message: String,
},
NotMember {
guild_id: u64,
message: String,
},
NotOwner {
guild_id: u64,
message: String,
},
NotBotOwner {
bot_id: u64,
message: String,
},
NotMessageAuthor {
message_id: u64,
message: String,
},
RoleTooLow {
guild_id: u64,
top_role_id: u64,
top_role_position: u16,
desired_position: u16,
message: String,
},
MissingPermissions {
guild_id: u64,
permissions: Permissions,
message: String,
},
RoleIsManaged {
guild_id: u64,
role_id: u64,
message: String,
},
CannotLeaveAsOwner {
id: u64,
message: String,
},
CannotActOnSelf {
message: String,
},
CannotFriendBots {
target_id: u64,
message: String,
},
UserInteractionDisallowed {
interaction_type: UserInteractionType,
target_id: u64,
message: String,
},
BlockedByUser {
target_id: u64,
message: String,
},
AlreadyTaken {
what: String,
message: String,
},
AlreadyExists {
what: String,
message: String,
},
Ratelimited {
retry_after: f32,
ip: String,
message: String,
},
InternalError {
what: Option<String>,
message: String,
debug: Option<String>,
},
}Expand description
An error that occurs within Adapt.
Variants§
MalformedBody
Received a malformed JSON or MsgPack body.
Fields
error_type: MalformedBodyErrorTypeExtra information about the error.
MissingBody
You are missing the request body in an endpoint that requires it. This is commonly JSON or MsgPack.
InvalidField
Invalid field in the request body.
MissingField
You are missing a required field in the request body.
MalformedIp
Could not resolve a plausible IP address from the request.
NotFound
The entity was not found.
GuildOnly
This operation is only allowed in guilds.
UnsupportedAuthMethod
Tried authorizing a bot account with anything but an authentication token.
InvalidToken
The request required a valid authentication token, but one of the following happened:
- The token was not provided.
- The token was malformed, i.e. a non-UTF-8 string.
- The token does not exist or is invalid.
InvalidCredentials
Invalid login credentials were provided, i.e. an invalid password.
InvalidCaptcha
Invalid Turnstile CAPTCHA token was provided. This is a token provided by Cloudflare when a user completes a CAPTCHA, and is used while registering new users to prevent spam.
NotMember
You must be a member of the guild to perform the requested action.
NotOwner
You must be the owner of the guild to perform the requested action.
Fields
NotBotOwner
You must be the owner of the bot to perform the requested action.
NotMessageAuthor
You are not the author of the message you are trying to edit.
Fields
RoleTooLow
You are too low in the role hierarchy to perform the requested action.
Fields
MissingPermissions
You are missing the required permissions to perform the requested action.
Fields
permissions: PermissionsThe permissions required to perform the requested action.
RoleIsManaged
You are trying to delete a managed role.
Fields
CannotLeaveAsOwner
You cannot leave a server or group DM that you are the owner of (you should transfer ownership before leaving).
Fields
CannotActOnSelf
You cannot perform the requested action on yourself.
CannotFriendBots
You cannot add bots as friends.
UserInteractionDisallowed
The user you are trying to interact with (e.g. add as a friend, open DMs, etc.) has privacy settings that prevent you from doing so.
Fields
interaction_type: UserInteractionTypeThe type of interaction that was disallowed.
BlockedByUser
The user has blocked you, so you cannot interact with them.
AlreadyTaken
Something was already taken, e.g. a username or email.
AlreadyExists
Something already exists, e.g. a relationship.
Ratelimited
You are sending requests too quickly are you are being rate limited.
Fields
InternalError
Internal server error occured, this is likely a bug.