//! 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 by the keychain access integration.
#[cfg(target_os = "macos")]
#[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),
}