Add ExecutionOperationError
Add an error which will be used in execution adapter methods as an error
result value.
@@ -65,3 +65,27 @@ impl fmt::Display for ExecutionAdapterError {
}
}
}
+
+#[derive(Debug)]
+pub enum ExecutionOperationError {
+ /// An error occurred on `ExecutionAdaptor.start`
+ StartError(String),
+
+ /// An error occurred on `ExecutionAdaptor.execute`
+ ExecuteError(String),
+
+ /// An error occurred on `ExecutionAdaptor.stop`
+ StopError(String),
+}
+
+impl Error for ExecutionOperationError {}
+
+impl fmt::Display for ExecutionOperationError {
+ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+ match self {
+ ExecutionOperationError::StartError(s) => write!(f, "Start Error: {}", s),
+ ExecutionOperationError::ExecuteError(s) => write!(f, "Execute Error: {}", s),
+ ExecutionOperationError::StopError(s) => write!(f, "Execute Error: {}", s),
+ }
+ }
+}
