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    #[cfg(feature = "http")]
8    #[error("{0}")]
9    HttpError(#[from] crate::http::error::HttpError),
10
11    /// WebSocket client error
12    #[cfg(feature = "websocket")]
13    #[error("{0}")]
14    WebsocketError(#[from] crate::ws::error::WebsocketError),
15
16    /// Missing/invalid configuration value
17    #[error("Missing/invalid required configuration: {0}")]
18    ConfigError(&'static str),
19
20    /// No WebSocket client initialized
21    #[cfg(feature = "websocket")]
22    #[error("No WebSocket client initialized")]
23    NoWebsocketClient
24}
25
26/// Result type alias for Websocket operations.
27pub type ClientResult<T> = Result<T, ClientError>;