improve error message for missing cache dir (closes #2)
This commit is contained in:
parent
e09bb69dbf
commit
7f619395fc
1 changed files with 3 additions and 2 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
use std::{path::PathBuf, sync::mpsc::Receiver};
|
use std::{path::PathBuf, sync::mpsc::Receiver};
|
||||||
|
|
||||||
use tracing::{debug, warn};
|
use tracing::{debug, error, warn};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
app_state::{CacheEntryMeta, Stats},
|
app_state::{CacheEntryMeta, Stats},
|
||||||
|
|
@ -47,7 +47,8 @@ pub fn init_from_disk(
|
||||||
lru_cache: &mut WeightedLRUCache<CacheEntryMeta>,
|
lru_cache: &mut WeightedLRUCache<CacheEntryMeta>,
|
||||||
stats: &mut Stats,
|
stats: &mut Stats,
|
||||||
) -> std::io::Result<()> {
|
) -> 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![];
|
let mut cache_entries = vec![];
|
||||||
for entry in entries {
|
for entry in entries {
|
||||||
match entry {
|
match entry {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue