1
0
Fork 0

[Configuration] Change error message

This commit is contained in:
Florian RICHER 2023-03-13 19:59:21 +01:00
parent 980722c6cb
commit cbe2b96295

View file

@ -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()
}