From 2ae74269ea6132b8ebedff6335a171ee25371e85 Mon Sep 17 00:00:00 2001 From: Thomas Date: Wed, 20 Mar 2024 15:11:23 +0100 Subject: [PATCH] Added an error message for when the config.json file is missing --- src/config.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config.rs b/src/config.rs index 807a121..fe381a6 100644 --- a/src/config.rs +++ b/src/config.rs @@ -40,7 +40,7 @@ impl Config { } pub fn from_json(file_name: String) -> Config { - let mut file = File::open(file_name).unwrap(); + let mut file = File::open(file_name).expect("Error opening config.json file. Go to the readme file and paste the example."); let mut buf = String::new(); file.read_to_string(&mut buf).expect("Error reading config file content."); let json: Value = serde_json::from_str(&buf).expect("Error parsing config file");