From 0d9d63219532d44f1e4adb8a4ea1fef834169205 Mon Sep 17 00:00:00 2001 From: Nick Pegg Date: Wed, 7 May 2025 20:57:14 -0700 Subject: [PATCH] better error message about missing config --- src/config.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/config.rs b/src/config.rs index b62ae95..9152206 100644 --- a/src/config.rs +++ b/src/config.rs @@ -17,8 +17,12 @@ pub struct Config { impl Config { pub fn from_album(path: PathBuf) -> anyhow::Result { let config_path = path.join("photojawn.conf.yml"); - let content = fs::read(&config_path) - .with_context(|| format!("Failed to read config from {}", config_path.display()))?; + let content = fs::read(&config_path).with_context(|| { + format!( + "Failed to read config from {}. Is this an album directory?", + config_path.display(), + ) + })?; let cfg = serde_yml::from_slice(&content) .with_context(|| format!("Failed to parse config from {}", config_path.display()))?; Ok(cfg)