use std::fmt; use crate::db::UserRef; pub type BoxedError = Box; #[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 {}