use std::error::Error;
use std::fmt;
use serde::{
Deserialize,
Serialize,
};
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct AttemptExecutorError {
message: Box<str>,
}
impl AttemptExecutorError {
#[inline]
pub fn new(message: &str) -> Self {
Self {
message: message.into(),
}
}
#[inline]
pub fn message(&self) -> &str {
&self.message
}
}
impl fmt::Display for AttemptExecutorError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(&self.message)
}
}
impl Error for AttemptExecutorError {}