pub use crate::binary::errors::{HeaderError, OpenError, UnlockError, WriteError};
pub use crate::binary::FailedUnlock;
pub use crate::crypto::KeyGenerationError;
pub use crate::stream::random::InnerStreamError;
pub use crate::xml::parse::Error as XmlReadError;
pub use crate::xml::serialize::Error as XmlWriteError;
use thiserror::Error;
#[derive(Error, Debug)]
pub enum Error {
#[error("Could not open database: {0}")]
Open(#[from] OpenError),
#[error("Could not unlock database: {0}")]
Unlock(#[from] UnlockError),
#[error("Could not write database: {0}")]
Write(#[from] WriteError),
#[error("Failed to parse database XML: {0}")]
XmlRead(#[from] XmlReadError),
#[error("Failed to write database XML: {0}")]
XmlWrite(#[from] XmlWriteError),
#[error("Failed to create encryption keys")]
KeyGeneration(#[from] KeyGenerationError),
}
impl From<FailedUnlock> for Error {
fn from(funlock: FailedUnlock) -> Error {
Error::Unlock(funlock.1)
}
}