#[derive(Debug, thiserror::Error)]
pub enum SocketIoError {
    #[error("invalid packet: {0}")]
    InvalidPacket(String),
    #[error("unknown session")]
    UnknownSession,
    #[error("unknown namespace: {0}")]
    UnknownNamespace(String),
    #[error("ack timeout")]
    AckTimeout,
    #[error("serialization failed: {0}")]
    Serialization(#[from] serde_json::Error),
    #[error("redis failed: {0}")]
    Redis(#[from] redis::RedisError),
    #[error("adapter failed: {0}")]
    Adapter(String),
}

pub type Result<T> = std::result::Result<T, SocketIoError>;
