From ef75ecda08e1c0899ac0735454deb408ced75bd6 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sun, 7 Apr 2024 18:37:01 +0100 Subject: [PATCH] feat(server): log error when fails to load config --- src/server/mod.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/server/mod.rs b/src/server/mod.rs index c08342db..9639ce55 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -2,7 +2,7 @@ mod config; use std::path::PathBuf; -use tracing::info; +use tracing::{error, info}; use crate::filesystem::FileSystem; @@ -30,7 +30,14 @@ pub fn start(fs: FileSystem) { return; }; info!("Starting Server..."); - let _config = config::Config::load(&fs); + let config = match config::Config::load(&fs) { + Ok(config) => config, + Err(err) => { + error!("Failed to load config file. Error: {}", err); + return; + } + }; + info!("Config loaded"); // todo!() }