use thiserror::Error;
#[derive(Error, Debug)]
pub enum Error {
#[error(transparent)]
IoError(#[from] std::io::Error),
#[error(transparent)]
ParsecClientError(#[from] parsec_client::error::Error),
#[error(transparent)]
ParsecInterfaceError(#[from] parsec_client::core::interface::requests::ResponseStatus),
#[error(transparent)]
ParsecToolError(#[from] ToolErrorKind),
#[error(transparent)]
Base64Decode(#[from] base64::DecodeError),
#[error(transparent)]
RcgenError(#[from] rcgen::RcgenError),
}
#[derive(Error, Debug)]
pub enum ToolErrorKind {
#[error("Operation not supported by the parsec-tool")]
NotSupported,
#[error("They key was not created with the correct algorithm for this operation")]
WrongKeyAlgorithm,
#[error("A command expected input data that was not given")]
NoInput,
#[error("Incorrect data format")]
IncorrectData,
}
pub type Result<T> = std::result::Result<T, Error>;