#[derive(Debug)]
pub enum ExecutorError {
NotStarted,
AlreadyStarted(String),
ResourcesUnavailable(String),
}
impl std::error::Error for ExecutorError {}
impl std::fmt::Display for ExecutorError {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
match self {
ExecutorError::NotStarted => f.write_str("Executor not started"),
ExecutorError::AlreadyStarted(ref msg) => {
write!(f, "Executor already started: {}", msg)
}
ExecutorError::ResourcesUnavailable(ref msg) => {
write!(f, "Resource Unavailable: {}", msg)
}
}
}
}