botkit_core/error.rs
1use thiserror::Error;
2
3/// Main error type for bot operations
4///
5/// A clean shutdown is not an error: [`crate::Bot::run_until`] returns `Ok(())`
6/// when its signal fires.
7#[derive(Debug, Error)]
8pub enum BotError {
9 #[error("connection failed: {0}")]
10 Connection(String),
11
12 #[error("authentication failed: {0}")]
13 Auth(String),
14
15 #[error("API request failed: {0}")]
16 Api(String),
17
18 #[error("serialization error: {0}")]
19 Serialization(#[from] serde_json::Error),
20
21 #[error("{0}")]
22 Other(String),
23}