#[derive(thiserror::Error, Debug)]
pub enum AppErr {
#[cfg(feature = "interactive")]
#[error("Error generating certificate: {0}")]
RcGen(#[from] rcgen::RcgenError),
#[error("You didn't enter any domains")]
RcGenNoDomains,
#[error("Failed to save: {0}")]
Save(#[from] std::io::Error),
#[error("Certificate generation stopped.")]
RcGenStop,
#[error("Key file ({1}) is either missing or corrupt: {0}")]
Key(openssl::error::ErrorStack, String),
#[error("Certificate file ({1}) is either missing or corrupt: {0}")]
Cert(openssl::error::ErrorStack, String),
#[error("Fluffer failed to bind address: {0}")]
Bind(std::io::Error),
#[error(transparent)]
SslStack(#[from] openssl::error::ErrorStack),
#[error(transparent)]
SslError(#[from] openssl::ssl::Error),
#[error(transparent)]
Time(#[from] std::time::SystemTimeError),
}
#[derive(thiserror::Error, Debug)]
pub enum StreamErr {
#[error("📚 Reading stream: {0}")]
Read(std::io::Error),
#[error("🖌️ Writing stream: {0}")]
Write(std::io::Error),
#[error("🔗 Decoding url percents: {0}")]
UrlDecode(std::string::FromUtf8Error),
#[error("🔗 Parsing url: {0}")]
UrlParse(#[from] url::ParseError),
#[error(transparent)]
Utf8(#[from] std::str::Utf8Error),
#[error(transparent)]
SslError(#[from] openssl::ssl::Error),
#[error(transparent)]
IO(#[from] std::io::Error),
#[error("🌕 Titan parameters are malformed: {0}")]
TitanParams(String),
#[error("🌕 Titan `size` parse error: {0}")]
TitanSize(std::num::ParseIntError),
#[error("📚 🌕 Titan read error: {0}")]
TitanRead(std::io::Error),
#[error("🔗 🌕 Titan token is badly encoded: {0}")]
TitanToken(std::string::FromUtf8Error),
}
#[derive(thiserror::Error, Debug)]
pub enum ClientErr {
#[error("Your certficate is expired")]
ExpiredCert,
#[error("Your certificate's expiration date couldn't be determined.")]
Ssl(#[from] openssl::error::ErrorStack),
}