From 8bd2a5753b213f5c7e92d9acb1d4172e6097eac8 Mon Sep 17 00:00:00 2001 From: Matthieu Bessat Date: Fri, 19 Apr 2024 14:50:29 +0200 Subject: [PATCH] fix: accept dotenv failure --- src/main.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 1f69643..034cf9f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -146,7 +146,10 @@ enum SourceType { #[tokio::main] async fn main() { let app: App = argh::from_env(); - dotenvy::dotenv().expect("Could not load dot env file"); + match dotenvy::dotenv() { + Ok(_) => eprintln!("Loaded env vars from .env"), + Err(err) => eprintln!("WARNING: loading .env failed {:?}", err), + } let config: Config = envy::from_env().expect("Failed to load env vars"); if app.env_info {