sos-migrate 0.17.1

Import and export for the Save Our Secrets SDK
Documentation
//! Error type for the library.
use thiserror::Error;

/// Error type for the migration library.
#[derive(Debug, Error)]
pub enum Error {
    /// Error generated from strings.
    #[error("{0}")]
    Message(String),

    /// Error generated when an unknown import format is detected.
    #[error(r#"import format "{0}" is not supported"#)]
    UnknownImportFormat(String),

    /// Error generated when no authenticator URLs were found.
    #[error("no authenticator URLs found in zip archive '{0}'")]
    NoAuthenticatorUrls(String),

    /// Error generated by the io module.
    #[error(transparent)]
    Io(#[from] std::io::Error),

    /// Error generated by the vault library.
    #[error(transparent)]
    Core(#[from] sos_core::Error),

    /// Error generated by the backend library.
    #[error(transparent)]
    Backend(#[from] sos_backend::Error),

    /// Error generated by the vault library.
    #[error(transparent)]
    Vault(#[from] sos_vault::Error),

    /// Error generated by the CSV library.
    #[error(transparent)]
    Csv(#[from] csv_async::Error),

    /// Error generated by the ZIP library.
    #[error(transparent)]
    Zip(#[from] async_zip::error::ZipError),

    /// Error generated by the JSON library.
    #[error(transparent)]
    Json(#[from] serde_json::Error),

    /// Error generated by the URL library.
    #[error(transparent)]
    Url(#[from] url::ParseError),

    /// Error generated by the TOTP library.
    #[error(transparent)]
    TotpUrl(#[from] totp_rs::TotpUrlError),

    #[cfg(all(
        target_os = "macos",
        feature = "import",
        feature = "keychain-access"
    ))]
    /// Error generated by the keychain import library.
    #[error(transparent)]
    Keychain(#[from] crate::import::keychain::Error),

    #[cfg(all(
        target_os = "macos",
        feature = "import",
        feature = "keychain-access"
    ))]
    /// Error generated by the keychain parser library.
    #[error(transparent)]
    KeychainParser(#[from] keychain_parser::Error),
}