use thiserror::Error;
#[derive(Error, Debug)]
pub enum ScrollError {
#[error("Connection failed: {0}")]
Connection(String),
#[error("Authentication failed: invalid password")]
AuthenticationFailed,
#[error("SSH error: {0}")]
Ssh(#[from] russh::Error),
#[error("SSH key error: {0}")]
SshKey(#[from] russh_keys::Error),
#[error("IO error: {0}")]
Io(#[from] std::io::Error),
#[error("Tunnel error: {0}")]
Tunnel(String),
#[error("Terminal error: {0}")]
Terminal(String),
#[error("Room is full (max {0} connections)")]
RoomFull(usize),
#[error("Channel closed")]
ChannelClosed,
#[error("{0}")]
Other(String),
}
pub type Result<T> = std::result::Result<T, ScrollError>;