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("hook failed: {command}")]
23    Hook { command: String },
24
25    #[error("changelog error: {0}")]
26    Changelog(String),
27
28    #[error("version file error: {0}")]
29    VersionBump(String),
30
31    #[error(transparent)]
32    Other(#[from] anyhow::Error),
33}
34
35// Keep anyhow available for conversions even though it's pulled transitively through thiserror.
36// sr-core re-exports it so downstream crates don't need a direct dep.
37pub use anyhow;