Formatting the hp config validation error message (#271)

* Formatting config validation error

* Camel case typo in js client lib

* Changed error message
This commit is contained in:
Chalith Desaman
2021-03-16 18:40:18 +05:30
committed by GitHub
parent a3775c6864
commit b7e9301797
2 changed files with 4 additions and 6 deletions

View File

@@ -504,7 +504,7 @@
roundTime: m.round_time,
contractExecutionEnabled: m.contract_execution_enabled,
readRequestsEnabled: m.read_requests_enabled,
isFull_history_node: m.is_full_history_node,
isFullHistoryNode: m.is_full_history_node,
currentUnl: m.current_unl,
peers: m.peers
});

View File

@@ -340,7 +340,7 @@ namespace conf
startup_role = cfg.node.role = ROLE::VALIDATOR;
else
{
std::cerr << "Invalid mode. 'observer' or 'validator' expected.\n";
std::cerr << "Invalid role. 'observer' or 'validator' expected.\n";
return -1;
}
@@ -354,6 +354,7 @@ namespace conf
return -1;
}
jpath = "node.history_config";
cfg.node.history_config.max_primary_shards = node["history_config"]["max_primary_shards"].as<uint64_t>();
cfg.node.history_config.max_blob_shards = node["history_config"]["max_blob_shards"].as<uint64_t>();
@@ -769,10 +770,7 @@ namespace conf
void print_missing_field_error(std::string_view jpath, const std::exception &e)
{
// Extract field name from jsoncons exception message.
std::string msg = e.what();
msg.erase(0, msg.find("'") + 1);
const std::string field = msg.substr(0, msg.find("'"));
std::cerr << "Required config field '" << jpath << "." << field << "' missing at " << ctx.config_file << std::endl;
std::cerr << "Config validation error: " << e.what() << " in '" << jpath << "' section at " << ctx.config_file << std::endl;
}
/**