:-'Generic Commit'
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user