Skip to main content

database_bootstrap/
error.rs

1//! Bootstrap error types.
2
3/// Bootstrap step execution errors.
4#[derive(Debug, thiserror::Error)]
5pub enum BootstrapError<Err: std::error::Error> {
6    /// A bootstrap step failed during execution.
7    #[error("bootstrap step '{step}' failed: {message}")]
8    StepFailed { step: &'static str, message: String },
9
10    /// A required dependency was not satisfied.
11    #[error("bootstrap step '{step}' dependency '{dependency}' not satisfied")]
12    DependencyNotSatisfied {
13        step: &'static str,
14        dependency: &'static str,
15    },
16
17    /// Verification failed after running a step.
18    #[error("bootstrap step '{step}' verification failed: expected {expected}, got {actual}")]
19    VerificationFailed {
20        step: &'static str,
21        expected: String,
22        actual: String,
23    },
24
25    /// A circular dependency was detected in the step graph.
26    #[error("circular dependency detected involving step '{step}'")]
27    CircularDependency { step: &'static str },
28
29    /// A database error occurred during bootstrap.
30    #[error("database error during bootstrap: {0}")]
31    Database(#[from] Err),
32
33    /// An internal error occurred.
34    #[error("internal error: {0}")]
35    Internal(String),
36}