vc_runtime/backend/factory/error.rs
1//! Factory and registry errors.
2
3use thiserror::Error;
4
5#[non_exhaustive]
6#[derive(Debug, Error)]
7pub enum FactoryError {
8 #[error("failed to build backend '{backend}': {source}")]
9 BuildFailed {
10 backend: String,
11 #[source]
12 source: anyhow::Error,
13 },
14}
15
16impl FactoryError {
17 /// Helper to create a BuildFailed error for a specific backend.
18 pub fn backend(backend: impl Into<String>, source: impl Into<anyhow::Error>) -> Self {
19 Self::BuildFailed { backend: backend.into(), source: source.into() }
20 }
21}