sos_sdk/migrate/
error.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
//! Error type for the library.
use thiserror::Error;

/// Error type for the migration library.
#[derive(Debug, Error)]
pub enum Error {
    /// 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 keychain access integration.
    #[cfg(all(target_os = "macos", feature = "keychain-access"))]
    #[error(transparent)]
    Keychain(#[from] crate::migrate::import::keychain::Error),

    /// Error generated by the io module.
    #[error(transparent)]
    Io(#[from] std::io::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),
}