aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAria Shrimpton <me@aria.rip>2024-01-25 13:45:04 +0000
committerAria Shrimpton <me@aria.rip>2024-01-25 13:45:04 +0000
commite1c6e49698c4f99b1a5dc052812780b70868ee00 (patch)
tree4ce0fd785d0d45966d620fc4477bddf6368a629a /src
parent2944298c10918da40a3b4ccbf850029a317375a0 (diff)
raise error early if no candidates found
Diffstat (limited to 'src')
-rw-r--r--src/crates/candelabra/src/candidates.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/crates/candelabra/src/candidates.rs b/src/crates/candelabra/src/candidates.rs
index 0d76862..e8693e0 100644
--- a/src/crates/candelabra/src/candidates.rs
+++ b/src/crates/candelabra/src/candidates.rs
@@ -2,7 +2,7 @@
use std::{collections::HashMap, fs::metadata, time::SystemTime};
-use anyhow::{Context, Result};
+use anyhow::{bail, Context, Result};
use camino::{Utf8Path, Utf8PathBuf};
use log::{debug, warn};
use primrose::ContainerSelector;
@@ -100,6 +100,10 @@ impl State {
.map(|(k, v)| (k.to_string(), v))
.collect();
+ if candidates.iter().any(|(_, impls)| impls.is_empty()) {
+ bail!("Could not find candidates for all container types");
+ }
+
let mod_time = metadata(path)?.modified()?;
if let Err(e) = self.candidates.store.put(
path,