llldap/src/db/error.rs

16 lines
391 B
Rust
Raw Normal View History

2026-09-01 19:06:33 +02:00
use std::fmt;
use crate::db::UserRef;
2026-09-01 23:27:02 +02:00
pub type BoxedError = Box<dyn std::error::Error + Send + Sync + 'static>;
2026-09-01 19:06:33 +02:00
#[derive(Debug)]
pub struct UserAlreadyExists(pub UserRef);
impl fmt::Display for UserAlreadyExists {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "User already exists: {}", self.0)
}
}
impl std::error::Error for UserAlreadyExists {}