use std::{io, str::Utf8Error};
use thiserror::Error;
#[derive(Error, Debug)]
pub enum Error {
#[error(transparent)]
IoError(#[from] io::Error),
#[error(transparent)]
Utf8Error(#[from] Utf8Error),
#[error("Failed to parse the incoming Redis message.")]
ParserError(#[from] crate::message::ParserError),
#[error("Not subscribed to the supplied channel.")]
NotSubscribed,
#[error("No bytes are read from the socket, socket is closed.")]
ZeroBytesRead,
}
pub type Result<T> = std::result::Result<T, Error>;