Skip to content

Commit

Permalink
improve feature compiled out error
Browse files Browse the repository at this point in the history
  • Loading branch information
gjcolombo committed Dec 2, 2024
1 parent cd78f69 commit 15ad57c
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions bin/propolis-server/src/lib/spec/api_spec_v0.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ pub(crate) enum ApiSpecError {
NetworkBackendNotFound { backend: String, device: String },

#[allow(dead_code)]
#[error("support for component {0} compiled out")]
FeatureCompiledOut(String),
#[error("support for component {component} compiled out via {feature}")]
FeatureCompiledOut { component: String, feature: &'static str },

#[error("backend {0} not used by any device")]
BackendNotUsed(String),
Expand Down Expand Up @@ -308,7 +308,10 @@ impl TryFrom<InstanceSpecV0> for Spec {
}
#[cfg(feature = "omicron-build")]
ComponentV0::MigrationFailureInjector(_) => {
return Err(ApiSpecError::FeatureCompiledOut(device_name));
return Err(ApiSpecError::FeatureCompiledOut {
component: device_name,
feature: "omicron-build",
});
}
#[cfg(not(feature = "omicron-build"))]
ComponentV0::MigrationFailureInjector(mig) => {
Expand All @@ -322,7 +325,10 @@ impl TryFrom<InstanceSpecV0> for Spec {
| ComponentV0::SoftNpuPort(_)
| ComponentV0::SoftNpuP9(_)
| ComponentV0::P9fs(_) => {
return Err(ApiSpecError::FeatureCompiledOut(device_name));
return Err(ApiSpecError::FeatureCompiledOut {
component: device_name,
feature: "falcon",
});
}
#[cfg(feature = "falcon")]
ComponentV0::SoftNpuPciPort(port) => {
Expand Down

0 comments on commit 15ad57c

Please sign in to comment.