Skip to main content

dar_core/
error.rs

1#[derive(Debug)]
2pub enum CoreError {
3    General(String,),
4}
5impl From<String,> for CoreError {
6    fn from(s: String,) -> Self {
7        CoreError::General(s,)
8    }
9}
10impl std::fmt::Display for CoreError {
11    fn fmt(&self, f: &mut std::fmt::Formatter<'_,>,) -> std::fmt::Result {
12        match self {
13            CoreError::General(msg,) => write!(f, "{}", msg),
14        }
15    }
16}
17impl std::error::Error for CoreError {}