Add new error variants

This commit is contained in:
Elias Schriefer 2020-09-14 20:14:15 +02:00
parent bb9bfd3b62
commit 4bcb78164d

View File

@ -2,7 +2,8 @@
pub enum ServiceError {
NoPermission,
AlreadyStarted,
AlreadyStopped
AlreadyStopped,
IOError(std::io::Error)
}
impl core::fmt::Display for ServiceError {
@ -10,7 +11,8 @@ impl core::fmt::Display for ServiceError {
match self {
Self::NoPermission => write!(f, "no permission"),
Self::AlreadyStarted => write!(f, "already started"),
Self::AlreadyStopped => write!(f, "already stopped")
Self::AlreadyStopped => write!(f, "already stopped"),
Self::IOError(err) => write!(f, "IO error ({})", err)
}
}
}