From 027b7a5907ef7b7df5ed889932a8166e7d7f3877 Mon Sep 17 00:00:00 2001 From: Guilherme Lawless Date: Tue, 2 Jun 2020 15:33:54 +0100 Subject: [PATCH] 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 ``` --- nano/load_test/entry.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/nano/load_test/entry.cpp b/nano/load_test/entry.cpp index f5917aa8..99c65bd6 100644 --- a/nano/load_test/entry.cpp +++ b/nano/load_test/entry.cpp @@ -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 data_paths; for (auto i = 0; i < node_count; ++i)