errors.rs gelöscht

This commit is contained in:
Milo 2024-09-07 11:44:16 +00:00
parent 4db2f95dfa
commit 3db77df5cd

View file

@ -1,24 +0,0 @@
use argon2::password_hash::{Error as PasswordHashError, SaltString};
use thiserror::Error;
#[derive(Debug)]
pub struct ArgonError(pub PasswordHashError);
impl std::fmt::Display for ArgonError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}", self.0)
}
}
impl std::error::Error for ArgonError {}
#[derive(Error, Debug)]
pub enum MyError {
#[error("Error hashing password with salt {salt}: {source}")]
HashingError {
source: ArgonError,
salt: SaltString,
},
#[error("Failed to generate password")]
PasswordGenerationError,
}