From be9efbddb20acacccc78a9b56f51adb088ef3abf Mon Sep 17 00:00:00 2001 From: BlackDex Date: Sat, 31 Oct 2020 17:53:14 +0100 Subject: [PATCH] Emit warning generated by dotenv. Emit warning regarding the dotenv crate instead of silently passing on. This could help in troubleshooting configuration issues. This partially fixes #1196 by reporting the line regarding spaces. Solving that ticket by allowing spaces would be difficult from within bitwarden_rs it self. --- src/config.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/config.rs b/src/config.rs index 09f4ae2e..f6f224a3 100644 --- a/src/config.rs +++ b/src/config.rs @@ -53,7 +53,14 @@ macro_rules! make_config { impl ConfigBuilder { fn from_env() -> Self { - dotenv::from_path(".env").ok(); + match dotenv::from_path(".env") { + Ok(_) => (), + Err(err) => { + println!("[WARNING] There was an issue loading the .env file:"); + println!("[WARNING] {:?}\n", err); + () + } + }; let mut builder = ConfigBuilder::default(); $($(