Skip to main content

sr_core/
error.rs

1use thiserror::Error;
2
3#[derive(Debug, Error)]
4pub enum ReleaseError {
5    #[error("no commits found since tag {tag} ({sha})")]
6    NoCommits { tag: String, sha: String },
7
8    #[error(
9        "no releasable commits found in {commit_count} commit(s) since tag {tag} (no feat/fix/breaking changes)"
10    )]
11    NoBump { tag: String, commit_count: usize },
12
13    #[error("configuration error: {0}")]
14    Config(String),
15
16    #[error("git error: {0}")]
17    Git(String),
18
19    #[error("vcs provider error: {0}")]
20    Vcs(String),
21
22    #[error("changelog error: {0}")]
23    Changelog(String),
24
25    #[error("version file error: {0}")]
26    VersionBump(String),
27
28    #[error(transparent)]
29    Other(#[from] anyhow::Error),
30}
31
32// Keep anyhow available for conversions even though it's pulled transitively through thiserror.
33// sr-core re-exports it so downstream crates don't need a direct dep.
34pub use anyhow;