alex_db_lib/error.rs
1use std::fmt;
2
3#[derive(Debug)]
4pub enum Error {
5 NotFound,
6 ValueParse,
7}
8
9impl std::error::Error for Error {}
10
11impl fmt::Display for Error {
12 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
13 use Error::*;
14 match self {
15 NotFound => write!(f, "Not found."),
16 ValueParse => write!(f, "Problem with parsing value."),
17 }
18 }
19}