1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
pub type Result<T> = std::result::Result<T, Error>;

#[derive(Debug, thiserror::Error)]
pub enum Error {
    #[error("Serenity Error: {0}")]
    SerenityError(#[from] serenity::Error),

    #[error("Page {0} not found")]
    PageNotFound(usize),

    #[error("Serenity Rich Interaction is not fully initialized")]
    Uninitialized,

    #[error("the cache is not available, therefore some required data is missing")]
    NoCache,

    #[error("{0}")]
    Msg(String),
}