[Configuration] Change error message
This commit is contained in:
parent
980722c6cb
commit
cbe2b96295
1 changed files with 3 additions and 2 deletions
|
@ -10,9 +10,10 @@ pub struct Configuration {
|
||||||
impl Configuration {
|
impl Configuration {
|
||||||
pub fn read_or_create() -> Self {
|
pub fn read_or_create() -> Self {
|
||||||
let path = std::path::Path::new("configuration.yml");
|
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);
|
let buffer = std::io::BufReader::new(file);
|
||||||
use std::io::Read;
|
|
||||||
serde_yaml::from_reader(buffer).unwrap()
|
serde_yaml::from_reader(buffer).unwrap()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in a new issue