From 8f7a0f26feb50dfbb92ae49f5e67fd22779d708d Mon Sep 17 00:00:00 2001
From: Fontrodona Nicolas <nicolas.fontrodona@ens-lyon.fr>
Date: Wed, 1 Feb 2023 17:10:26 +0100
Subject: [PATCH] src/remote.rs: update error message

---
 src/remote.rs | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/src/remote.rs b/src/remote.rs
index 4b09bdc..269686f 100644
--- a/src/remote.rs
+++ b/src/remote.rs
@@ -55,7 +55,17 @@ pub fn parse_config(global: bool) -> Config {
             exit(1);
         }
     }
-    let config_str: Config = toml::from_str(&content).unwrap();
+    let config_str: Config = match toml::from_str(&content) {
+        Ok(config) => config,
+        Err(_) => {
+            eprintln!(
+                "{}: bad {} configuration file !",
+                "error".red(),
+                &config_file.display()
+            );
+            exit(1);
+        }
+    };
     config_str.check_project_type(global, &config_file);
     config_str
 }
-- 
GitLab