1use thiserror::Error;
2
3#[derive(Debug, Error)]
5pub enum TitaniumError {
6 #[error("Gateway error: {0}")]
8 Gateway(#[from] titanium_gateway::error::GatewayError),
9
10 #[error("HTTP error: {0}")]
12 Http(#[from] titanium_http::error::HttpError),
13
14 #[error("Framework error: {0}")]
16 Framework(String),
17
18 #[error("Context error: {0}")]
20 Context(#[from] ContextError),
21
22 #[error("Error: {0}")]
24 Other(#[from] Box<dyn std::error::Error + Send + Sync>),
25}
26
27#[derive(Debug, Error)]
29pub enum ContextError {
30 #[error("No interaction present in context")]
31 NoInteraction,
32 #[error("Already responded to interaction")]
33 AlreadyResponded,
34 #[error("HTTP error: {0}")]
35 Http(#[from] titanium_http::error::HttpError),
36}