sparkle_impostor/
error.rs1use twilight_validate::{channel::ChannelValidationError, message::MessageValidationError};
4
5#[derive(Debug, thiserror::Error)]
7pub enum Error {
8 #[error("message is not in a guild")]
10 NotInGuild,
11 #[error("message is related to rich presence")]
13 RichPresence,
14 #[error("message is a voice message")]
16 Voice,
17 #[error("message is a system message")]
19 System,
20 #[error("message has a non-URL component")]
22 Component,
23 #[error("message has a reaction")]
25 Reaction,
26 #[error("message has more reaction emojis than {0}")]
28 ReactionAboveLimit(u8),
29 #[error("message has a reaction emoji with count higher than one")]
31 ReactionCountMultiple,
32 #[error("message has a reaction emoji that's not unicode")]
34 ReactionCustom,
35 #[error("message has an external reaction emoji")]
37 ReactionExternal,
38 #[error("message has a sticker")]
40 Sticker,
41 #[error("sticker in message can't be linked to")]
43 StickerLinkInvalid,
44 #[error("message has an attachment")]
46 Attachment,
47 #[cfg(feature = "upload")]
52 #[error("message's attachments are too large")]
53 AttachmentTooLarge,
54 #[error("message's content is invalid")]
56 ContentInvalid,
57 #[error("message is not in last {0} messages")]
59 SourceAboveLimit(u16),
60 #[error("message has not been created yet")]
62 NotCreated,
63 #[error("deleting messages would use more than {0} request")]
65 DeleteRequestCountAboveLimit(u16),
66 #[error("{0}")]
68 Http(#[from] twilight_http::Error),
69 #[error("{0}")]
71 DeserializeBody(#[from] twilight_http::response::DeserializeBodyError),
72 #[error("{0}")]
74 Validation(#[from] twilight_validate::request::ValidationError),
75 #[error("{0}")]
77 MessageValidation(#[from] MessageValidationError),
78 #[error("{0}")]
80 ChannelValidation(#[from] ChannelValidationError),
81 #[cfg(feature = "upload")]
83 #[error("{0}")]
84 Reqwest(#[from] reqwest::Error),
85}