summaryrefslogtreecommitdiff
path: root/src/err.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/err.rs')
-rw-r--r--src/err.rs33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/err.rs b/src/err.rs
new file mode 100644
index 0000000..6a224a1
--- /dev/null
+++ b/src/err.rs
@@ -0,0 +1,33 @@
+use serde_yaml;
+use thiserror::Error;
+
+/// Errors that can be returned for roadmaps.
+#[derive(Error, Debug)]
+pub enum RoadmapError {
+ #[error("roadmap has no goals, must have exactly one")]
+ NoGoals,
+
+ #[error("too many goals, must have exactly one: found {count:}: {}", .names.join(", "))]
+ ManyGoals {
+ count: usize,
+ names: Vec<String>,
+ },
+
+ #[error("step {name:} depends on missing {missing:}")]
+ MissingDep {
+ name: String,
+ missing: String,
+ },
+
+ #[error("step is not a mapping")]
+ StepNotMapping,
+
+ #[error("'depends' must be a list of step names")]
+ DependsNotNames,
+
+ #[error("unknown status: {0}")]
+ UnknownStatus(String),
+
+ #[error(transparent)]
+ SerdeError(#[from] serde_yaml::Error),
+}