Add parse error
This commit is contained in:
parent
ed1cafafd0
commit
00b4e60341
@ -16,6 +16,7 @@ pub(crate) enum Error {
|
||||
Io(std::io::Error),
|
||||
Log(log::SetLoggerError),
|
||||
LogBuilder(log4rs::config::Errors),
|
||||
Parse(std::num::ParseIntError),
|
||||
Serial(serde_json::Error),
|
||||
}
|
||||
|
||||
@ -29,6 +30,7 @@ impl fmt::Display for Error {
|
||||
Error::Io(e) => write!(fmt, "Io({})", e),
|
||||
Error::Log(e) => write!(fmt, "Log({})", e),
|
||||
Error::LogBuilder(e) => write!(fmt, "LogBuilder({})", e),
|
||||
Error::Parse(e) => write!(fmt, "Parse({})", e),
|
||||
Error::Serial(e) => write!(fmt, "Serial({})", e),
|
||||
}
|
||||
}
|
||||
@ -91,3 +93,9 @@ impl From<log4rs::config::Errors> for Error {
|
||||
Error::LogBuilder(err)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<std::num::ParseIntError> for Error {
|
||||
fn from(err: std::num::ParseIntError) -> Self {
|
||||
Error::Parse(err)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user