use ldap3::LdapError;
use thiserror::Error;
use windows_sys::core::HRESULT;
#[derive(Debug, Error)]
pub enum LapsError {
#[error("A ldap error occured: {source}")]
LdapError {
#[from]
source: LdapError,
},
#[error("{0}")]
ConversionError(String),
#[error("DPAPI had an error. Code: {0}")]
DpapiFailedToDecrypt(HRESULT),
#[error("The blob given was too short for the contained metadata")]
BlobTooShort,
#[error("Buffer was not of the expected length")]
InvalidBufLen,
#[error("{0} not found")]
NotFound(String),
#[error("{0}")]
Other(String),
}