diff --git a/src/main.rs b/src/main.rs index 771e2a8..4ed4896 100644 --- a/src/main.rs +++ b/src/main.rs @@ -26,8 +26,10 @@ impl EventHandler for Handler { #[tokio::main] async fn main() { let file_path = std::env::var("CONFIG_PATH").unwrap_or_else(|_| "./config.json".to_string()); - println!("reading config from {file_path}"); - let file = fs::read_to_string(file_path).unwrap(); + let file = match fs::read_to_string(file_path).unwrap_or_else(|err| { + eprintln!("Error reading config file ({file_path}): {err}"); + std::process:exit(1); + }); let config = serde_json::from_str::(&file).unwrap(); let token = &config.token;