#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive]
pub enum DagError {
TaskPanicked { task_id: u32, panic_message: String },
}
impl std::fmt::Display for DagError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
DagError::TaskPanicked {
task_id,
panic_message,
} => {
write!(
f,
"Task #{} panicked during execution: {}\n\
\n\
A task panicked, indicating a bug. The entire DAG execution is aborted.",
task_id, panic_message
)
}
}
}
}
impl std::error::Error for DagError {}
#[cfg(not(tarpaulin_include))]
pub type DagResult<T> = Result<T, DagError>;
#[cfg(test)]
mod tests;