diff --git a/src/daemon/configuration/mod.rs b/src/daemon/configuration/mod.rs index 8f83f1f..294a921 100644 --- a/src/daemon/configuration/mod.rs +++ b/src/daemon/configuration/mod.rs @@ -10,9 +10,10 @@ pub struct Configuration { impl Configuration { pub fn read_or_create() -> Self { let path = std::path::Path::new("configuration.yml"); - let file = std::fs::File::open(path).unwrap(); + let file = std::fs::File::open(path) + .map_err(|_| format!("No such file configuration.yml")) + .unwrap(); let buffer = std::io::BufReader::new(file); - use std::io::Read; serde_yaml::from_reader(buffer).unwrap() }