mirror of
https://github.com/EvernodeXRPL/hpcore.git
synced 2026-04-29 15:37:59 +00:00
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:
@@ -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
|
||||
});
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user