diff --git a/src/eh0/error.rs b/src/eh0/error.rs index 43f2e0b..9a7b82d 100644 --- a/src/eh0/error.rs +++ b/src/eh0/error.rs @@ -3,6 +3,9 @@ use std::{error::Error as StdError, fmt, io}; /// Errors that may occur during mocking. #[derive(PartialEq, Eq, Clone, Debug)] pub enum MockError { + /// An error occurred without any details. + NoDetails, + /// An I/O-Error occurred Io(io::ErrorKind), } @@ -16,6 +19,7 @@ impl From for MockError { impl fmt::Display for MockError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match self { + MockError::NoDetails => write!(f, "An error occurred without any details"), MockError::Io(kind) => write!(f, "I/O error: {:?}", kind), } } diff --git a/src/eh1/error.rs b/src/eh1/error.rs index c14d2f2..873c6a8 100644 --- a/src/eh1/error.rs +++ b/src/eh1/error.rs @@ -6,6 +6,9 @@ use embedded_hal::digital::ErrorKind::{self, Other}; /// Errors that may occur during mocking. #[derive(PartialEq, Eq, Clone, Debug)] pub enum MockError { + /// An error occurred without any details. + NoDetails, + /// An I/O-Error occurred Io(io::ErrorKind), } @@ -25,6 +28,7 @@ impl From for MockError { impl fmt::Display for MockError { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match self { + MockError::NoDetails => write!(f, "An error occurred without any details"), MockError::Io(kind) => write!(f, "I/O error: {:?}", kind), } }