1use thiserror::Error;
9
10#[derive(Debug, Error)]
11pub enum KitError {
12 #[error("dependency cycle detected: {}", cycle.join(" → "))]
13 CycleDetected { cycle: Vec<&'static str> },
14
15 #[error("module `{module}` depends on `{missing}` which is not registered")]
16 DependencyMissing {
17 module: &'static str,
18 missing: &'static str,
19 },
20
21 #[deprecated(note = "typestate pattern makes this unreachable; will be removed in 0.3.0")]
22 #[error("kit is not ready; call build() first")]
23 NotReady,
24
25 #[error("module `{module}` is already registered")]
26 AlreadyRegistered { module: &'static str },
27
28 #[error("failed to build `{context}`: {source}")]
29 BuildFailed {
30 context: &'static str,
31 #[source]
32 source: Box<dyn std::error::Error + Send + 'static>,
33 },
34
35 #[error("missing capability `{key}`")]
36 MissingCapability { key: &'static str },
37
38 #[error("missing config `{key}`")]
39 MissingConfig { key: &'static str },
40}