1use thiserror::Error;
2
3#[derive(Debug, Error)]
4pub enum FrontMatterError {
5 #[error("missing opening delimiter '---'")]
6 MissingOpeningDelimiter,
7
8 #[error("missing closing delimiter '---'")]
9 MissingClosingDelimiter,
10
11 #[error("front matter is empty")]
12 EmptyFrontMatter,
13}
14
15#[derive(Debug, Error)]
16pub enum ValidationError {
17 #[error("changeset must contain at least one release")]
18 NoReleases,
19
20 #[error("input exceeds maximum size of {max_bytes} bytes")]
21 InputTooLarge { max_bytes: usize },
22}
23
24#[derive(Debug, Error)]
25pub enum FormatError {
26 #[error("failed to parse YAML: {0}")]
27 Yaml(#[from] serde_yml::Error),
28
29 #[error(transparent)]
30 FrontMatter(#[from] FrontMatterError),
31
32 #[error(transparent)]
33 Validation(#[from] ValidationError),
34}