sms_client/
error.rs

1//! Websocket interface related errors.
2
3/// Client-level errors.
4#[derive(thiserror::Error, Debug)]
5pub enum ClientError {
6    /// HTTP client error
7    #[error("{0}")]
8    HttpError(#[from] crate::http::error::HttpError),
9
10    /// WebSocket client error
11    #[cfg(feature = "websocket")]
12    #[error("{0}")]
13    WebsocketError(#[from] crate::ws::error::WebsocketError),
14
15    /// Missing some configuration value
16    #[error("Missing required configuration: {0}")]
17    MissingConfiguration(&'static str),
18
19    /// No WebSocket client initialized
20    #[cfg(feature = "websocket")]
21    #[error("No WebSocket client initialized")]
22    NoWebsocketClient
23}
24
25/// Result type alias for Websocket operations.
26pub type ClientResult<T> = Result<T, ClientError>;