titanium_rs/
error.rs

1use thiserror::Error;
2
3/// Unified error type for the Titanium framework.
4#[derive(Debug, Error)]
5pub enum TitaniumError {
6    /// Errors from the Gateway (WebSocket, Sharding).
7    #[error("Gateway error: {0}")]
8    Gateway(#[from] titanium_gateway::error::GatewayError),
9
10    /// Errors from the HTTP client (REST API).
11    #[error("HTTP error: {0}")]
12    Http(#[from] titanium_http::error::HttpError),
13
14    /// Errors from the Framework (Command handling).
15    #[error("Framework error: {0}")]
16    Framework(String),
17
18    /// Generic errors from user code or other sources.
19    #[error("Error: {0}")]
20    Other(#[from] Box<dyn std::error::Error + Send + Sync>),
21}