use super::phase::StartupPhase;
#[derive(Debug, Clone, thiserror::Error)]
pub enum StartupError {
#[error("subsystem '{subsystem}' failed during {phase:?}: {reason}")]
SubsystemFailed {
phase: StartupPhase,
subsystem: String,
reason: String,
},
#[error(
"ReadyGate for subsystem '{subsystem}' at {phase:?} was dropped without firing — \
startup would have deadlocked"
)]
GateDroppedWithoutFire {
phase: StartupPhase,
subsystem: String,
},
#[error("startup sequencer already terminated")]
AlreadyTerminated,
}
impl From<StartupError> for crate::Error {
fn from(e: StartupError) -> Self {
crate::Error::Config {
detail: e.to_string(),
}
}
}