:-'Generic Commit'

This commit is contained in:
Your Name
2025-05-29 18:37:41 +12:00
parent 2444180a96
commit 73297c40b9
6 changed files with 84 additions and 59 deletions

View File

@@ -8,6 +8,19 @@ namespace simple_object_storage {
bool load_config(const std::string& config_path, ServerConfig& config) {
try {
if (config_path.empty()) {
std::cerr << "Config path is empty" << std::endl;
return false;
}
if (!std::filesystem::exists(config_path)) {
std::cerr << "Config file does not exist: " << config_path << std::endl;
return false;
}
if (!std::filesystem::is_regular_file(config_path)) {
std::cerr << "Config file is not a regular file: " << config_path << std::endl;
return false;
}
std::ifstream file(config_path);
if (!file.is_open()) {
std::cerr << "Failed to open config file: " << config_path << std::endl;