use std::{ error::Error, fmt::{Display, Formatter, Result}, }; #[derive(Debug)] pub struct ScootalooError { details: String, } impl ScootalooError { pub fn new(msg: &str) -> ScootalooError { ScootalooError { details: msg.to_string(), } } } impl Error for ScootalooError {} impl Display for ScootalooError { fn fmt(&self, f: &mut Formatter) -> Result { write!(f, "{}", self.details) } }