use thiserror::Error;
#[derive(Error, Debug)]
pub enum NntpError {
#[error("Connection error: {0}")]
Connection(String),
#[error("TLS error: {0}")]
Tls(String),
#[error("Authentication failed: {0}")]
Auth(String),
#[error("Authentication required: {0}")]
AuthRequired(String),
#[error("Service unavailable: {0}")]
ServiceUnavailable(String),
#[error("Article not found: {0}")]
ArticleNotFound(String),
#[error("No such group: {0}")]
NoSuchGroup(String),
#[error("No article selected: {0}")]
NoArticleSelected(String),
#[error("Protocol error: {0}")]
Protocol(String),
#[error("I/O error: {0}")]
Io(#[from] std::io::Error),
#[error("No connections available for server {0}")]
NoConnectionsAvailable(String),
#[error("Timeout: {0}")]
Timeout(String),
#[error("All servers exhausted for article {0}")]
AllServersExhausted(String),
#[error("Downloader shut down")]
Shutdown,
}
pub type NntpResult<T> = std::result::Result<T, NntpError>;