Check executable paths in load_test (#2797)

To output a descriptive error message rather than:
```
terminate called after throwing an instance of
'boost::process::process_error'
  what():  execve failed: No such file or directory
```
This commit is contained in:
Guilherme Lawless 2020-06-02 15:33:54 +01:00 committed by GitHub
commit 027b7a5907
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -412,6 +412,11 @@ int main (int argc, char * const * argv)
}
node_path = node_filepath.string ();
}
if (!boost::filesystem::exists (node_path))
{
std::cerr << "nano_node executable could not be found in " << node_path << std::endl;
return 1;
}
auto rpc_path_it (vm.find ("rpc_path"));
std::string rpc_path;
@ -428,6 +433,11 @@ int main (int argc, char * const * argv)
}
rpc_path = rpc_filepath.string ();
}
if (!boost::filesystem::exists (rpc_path))
{
std::cerr << "nano_rpc executable could not be found in " << rpc_path << std::endl;
return 1;
}
std::vector<boost::filesystem::path> data_paths;
for (auto i = 0; i < node_count; ++i)