From 4bcb78164d1b598597b52ef7e6e88507f503fddc Mon Sep 17 00:00:00 2001 From: EliasSchriefer Date: Mon, 14 Sep 2020 20:14:15 +0200 Subject: [PATCH] Add new error variants --- sfsmcd/src/ifaces/errors.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sfsmcd/src/ifaces/errors.rs b/sfsmcd/src/ifaces/errors.rs index b613744..a7b0108 100644 --- a/sfsmcd/src/ifaces/errors.rs +++ b/sfsmcd/src/ifaces/errors.rs @@ -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) } } } \ No newline at end of file