#![allow(missing_docs)]
use alpaca_base::AlpacaError;
use thiserror::Error;
#[derive(Error, Debug)]
pub enum WebSocketError {
#[error(transparent)]
Base(#[from] AlpacaError),
#[error("WebSocket connection error: {0}")]
Connection(#[from] tokio_tungstenite::tungstenite::Error),
#[error("URL parsing error: {0}")]
Url(#[from] url::ParseError),
#[error("Connection closed: {0}")]
ConnectionClosed(String),
#[error("Authentication failed: {0}")]
AuthenticationFailed(String),
#[error("Subscription error: {0}")]
Subscription(String),
#[error("Message parsing error: {0}")]
MessageParsing(String),
#[error("Channel send error")]
ChannelSend,
#[error("Reconnection failed after {attempts} attempts")]
ReconnectionFailed { attempts: u32 },
}