use thiserror::Error;
#[derive(Debug, Error)]
pub enum RealtimeError {
#[error("invalid channel: {0}")]
InvalidChannel(String),
#[error("subscription limit exceeded: max {0} subscriptions")]
SubscriptionLimit(usize),
#[error("client not found: {0}")]
ClientNotFound(String),
#[error("failed to send message: {0}")]
SendFailed(String),
#[error("serialization error: {0}")]
Serialization(#[from] serde_json::Error),
#[error("channel closed")]
ChannelClosed,
}