improve error message for missing cache dir (closes #2)

This commit is contained in:
Markus Brueckner 2026-01-25 10:56:46 +01:00
parent e09bb69dbf
commit 7f619395fc

View file

@ -1,6 +1,6 @@
use std::{path::PathBuf, sync::mpsc::Receiver};
use tracing::{debug, warn};
use tracing::{debug, error, warn};
use crate::{
app_state::{CacheEntryMeta, Stats},
@ -47,7 +47,8 @@ pub fn init_from_disk(
lru_cache: &mut WeightedLRUCache<CacheEntryMeta>,
stats: &mut Stats,
) -> std::io::Result<()> {
let entries = std::fs::read_dir(&config.cache_dir)?;
let entries = std::fs::read_dir(&config.cache_dir)
.inspect_err(|e| error!("Could not open cache directory: {}", e))?;
let mut cache_entries = vec![];
for entry in entries {
match entry {