use alloc::string::String;
use thiserror::Error;
#[derive(Debug, Error)]
pub enum BumpError {
#[error("Configuration file not found: {0}")]
ConfigNotFound(String),
#[error("Invalid configuration: {0}")]
InvalidConfig(String),
#[error("Did not find '{0}' in file '{1}'")]
VersionNotFound(String, String),
#[error("Invalid parse regex '{0}': {1}")]
InvalidRegex(String, #[source] regex::Error),
#[error("Unknown version component: '{0}'")]
UnknownComponent(String),
#[error("Version component '{0}' is not a valid integer")]
InvalidComponentValue(String),
#[error("Git error during '{0}': {1}")]
GitError(String, String),
#[cfg(feature = "std")]
#[error("I/O error: {0}")]
Io(#[from] std::io::Error),
#[error("{0}")]
Other(String),
}
#[cfg(feature = "std")]
impl From<anyhow::Error> for BumpError {
fn from(err: anyhow::Error) -> Self {
Self::Other(err.to_string())
}
}