chore(server): gracefully exit when there is no config file found

This commit is contained in:
Orhun Parmaksız 2024-03-01 22:17:17 +03:00
parent db971e6434
commit 12f0e8f3a7
No known key found for this signature in database
GPG Key ID: F83424824B3E4B90
1 changed files with 7 additions and 0 deletions

View File

@ -61,6 +61,13 @@ fn setup(config_folder: &Path) -> IoResult<(Data<RwLock<Config>>, ServerConfig,
}
None => config_folder.join("config.toml"),
};
if !config_path.exists() {
error!(
"{} is not found, please provide a configuration file.",
config_path.display()
);
std::process::exit(1);
}
let config = Config::parse(&config_path).expect("failed to parse config");
trace!("{:#?}", config);
config.warn_deprecation();