#[cfg(all(feature = "alloc", not(feature = "std")))]
use alloc::string::{String, ToString};
pub type Result<T = (), E = Error> = core::result::Result<T, E>;
#[derive(Debug, thiserror::Error)]
#[non_exhaustive]
pub enum Error {
#[error(transparent)]
Core(#[from] shepherd_core::Error),
#[error(transparent)]
Template(#[from] minijinja::Error),
#[error("template not found: {0}")]
TemplateNotFound(String),
#[error("provenance mismatch for {artifact}: expected {expected}, produced {produced}")]
ProvenanceMismatch {
artifact: String,
expected: String,
produced: String,
},
#[error("{0}")]
Unknown(String),
}
impl Error {
pub fn unknown(message: impl core::fmt::Display) -> Self {
Self::Unknown(message.to_string())
}
}