whynot_errors/
setup_error.rs

1use std::fmt::Display;
2
3#[derive(Debug)]
4pub struct SetupError {
5    pub msg: String,
6}
7
8impl Display for SetupError {
9    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10        writeln!(f, "Setup Error: {}", self.msg)
11    }
12}
13
14impl SetupError {
15    pub fn new(msg: impl ToString) -> Self {
16        Self {
17            msg: msg.to_string(),
18        }
19    }
20}
21
22pub type SetupResult = Result<(), SetupError>;