core_crypto/error/
cryptobox_migration.rs#![allow(missing_docs)]
pub type CryptoboxMigrationError = super::WrappedContextualError<CryptoboxMigrationErrorKind>;
#[derive(Debug, thiserror::Error, strum::IntoStaticStr)]
pub enum CryptoboxMigrationErrorKind {
#[cfg(all(feature = "cryptobox-migrate", target_family = "wasm"))]
#[error(transparent)]
RexieError(rexie::Error),
#[cfg(all(feature = "cryptobox-migrate", target_family = "wasm"))]
#[error(transparent)]
IdbError(idb::Error),
#[cfg(all(feature = "cryptobox-migrate", target_family = "wasm"))]
#[error(transparent)]
JsonParseError(#[from] serde_wasm_bindgen::Error),
#[cfg(all(feature = "cryptobox-migrate", target_family = "wasm"))]
#[error(transparent)]
Base64DecodeError(#[from] base64::DecodeError),
#[error("The targeted value does not possess the targeted key ({0})")]
MissingKeyInValue(String),
#[error("The value cannot be coerced to the {0} type")]
WrongValueType(String),
#[cfg_attr(target_family = "wasm", error("The provided path [{0}] could not be found."))]
#[cfg_attr(
not(target_family = "wasm"),
error("The provided path store [{0}] is either non-existent or has an incorrect shape.")
)]
ProvidedPathDoesNotExist(String),
#[error("The Cryptobox identity at path [{0}] could not be found.")]
IdentityNotFound(String),
#[cfg(all(feature = "cryptobox-migrate", not(target_family = "wasm")))]
#[error(transparent)]
Io(#[from] std::io::Error),
#[cfg(feature = "cryptobox-migrate")]
#[error(transparent)]
ParseInt(#[from] std::num::ParseIntError),
}
#[cfg(all(feature = "cryptobox-migrate", target_family = "wasm"))]
impl From<rexie::Error> for CryptoboxMigrationErrorKind {
fn from(e: rexie::Error) -> Self {
match e {
rexie::Error::IdbError(e) => Self::IdbError(e),
_ => Self::RexieError(e),
}
}
}