use thiserror::Error;
#[derive(Debug, Error)]
pub enum Error {
#[error("{0}")]
Message(String),
#[error(r#"import format "{0}" is not supported"#)]
UnknownImportFormat(String),
#[error("no authenticator URLs found in zip archive '{0}'")]
NoAuthenticatorUrls(String),
#[error(transparent)]
Io(#[from] std::io::Error),
#[error(transparent)]
Core(#[from] sos_core::Error),
#[error(transparent)]
Backend(#[from] sos_backend::Error),
#[error(transparent)]
Vault(#[from] sos_vault::Error),
#[error(transparent)]
Csv(#[from] csv_async::Error),
#[error(transparent)]
Zip(#[from] async_zip::error::ZipError),
#[error(transparent)]
Json(#[from] serde_json::Error),
#[error(transparent)]
Url(#[from] url::ParseError),
#[error(transparent)]
TotpUrl(#[from] totp_rs::TotpUrlError),
#[cfg(all(
target_os = "macos",
feature = "import",
feature = "keychain-access"
))]
#[error(transparent)]
Keychain(#[from] crate::import::keychain::Error),
#[cfg(all(
target_os = "macos",
feature = "import",
feature = "keychain-access"
))]
#[error(transparent)]
KeychainParser(#[from] keychain_parser::Error),
}