use std::io;
pub type Result<T> = std::result::Result<T, Error>;
#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error("connection closed")]
ConnectionClosed,
#[error("not authenticated")]
NotAuthenticated,
#[error("authentication failed: {0}")]
AuthFailed(String),
#[error("protocol error: {0}")]
Protocol(String),
#[error("config error: {0}")]
Config(String),
#[error("io error: {0}")]
Io(#[from] io::Error),
#[error("no pending requests")]
NoPending,
#[error("all connections failed")]
AllConnectionsFailed,
}