Skip to content

Commit

Permalink
💚 fix: build
Browse files Browse the repository at this point in the history
  • Loading branch information
camargo2019 committed Sep 9, 2024
1 parent 4856a67 commit bbe4968
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions core/entities/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,20 +58,20 @@

Yaml::Node& connect = root["connect"];
if (connect.IsMap() == false){
throw std::exception("ERROR: We can't find connect in config/connect.yaml");
throw std::runtime_error("ERROR: We can't find connect in config/connect.yaml");
}

config_connect.max_clients = connect["max-clients"].As<int>();

Yaml::Node& auth = connect["auth"];
if (auth.IsMap() == false){
throw std::exception("ERROR: We can't find auth in config/connect.yaml");
throw std::runtime_error("ERROR: We can't find auth in config/connect.yaml");
}

Yaml::Node& authIPs = auth["allow-ip"];

if (authIPs.IsSequence() == false){
throw std::exception("ERROR: allow-ip is not a sequence in config/connect.yaml");
throw std::runtime_error("ERROR: allow-ip is not a sequence in config/connect.yaml");
}

for (auto aIP = authIPs.Begin(); aIP != authIPs.End(); aIP++){
Expand All @@ -81,7 +81,7 @@
Yaml::Node& basicAuth = auth["basic"];

if (basicAuth.IsSequence() == false){
throw std::exception("ERROR: basic-auth is not a sequence in config/connect.yaml");
throw std::runtime_error("ERROR: basic-auth is not a sequence in config/connect.yaml");
}

for (auto bAuth = basicAuth.Begin(); bAuth != basicAuth.End(); bAuth++){
Expand All @@ -104,7 +104,7 @@

Yaml::Node& rootHost = root["host"];
if (rootHost.IsMap() == false){
throw std::exception("ERROR: We can't find the host in config/host.yaml");
throw std::runtime_error("ERROR: We can't find the host in config/host.yaml");
}

host.address = rootHost["address"].As<std::string>();
Expand Down
2 changes: 1 addition & 1 deletion core/manager/manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ void Manager::invokeSet(std::vector<std::string> args){
try {
expire = std::stoi(args[2]);
}catch (std::exception& e){
std::cout << "Failed: " << args[0] << " " << args[1] << " " << args[2] << " | " << e.what() << std::endl;
std::cout << "Failed: " << e.what() << std::endl;
}
}

Expand Down

0 comments on commit bbe4968

Please sign in to comment.