use thiserror::Error;
#[non_exhaustive]
#[derive(Debug, Error)]
pub enum FactoryError {
#[error("failed to build backend '{backend}': {source}")]
BuildFailed {
backend: String,
#[source]
source: anyhow::Error,
},
}
impl FactoryError {
pub fn backend(backend: impl Into<String>, source: impl Into<anyhow::Error>) -> Self {
Self::BuildFailed { backend: backend.into(), source: source.into() }
}
}