Skip to content

Commit

Permalink
chore(server): gracefully exit when there is no config file found
Browse files Browse the repository at this point in the history
  • Loading branch information
orhun committed Mar 1, 2024
1 parent db971e6 commit 12f0e8f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 12f0e8f

Please sign in to comment.