diff --git a/include/storage/io_config.hpp b/include/storage/io_config.hpp index ab90298ede8..e52eb928b83 100644 --- a/include/storage/io_config.hpp +++ b/include/storage/io_config.hpp @@ -24,6 +24,7 @@ struct IOConfig } bool IsValid() const; + std::vector GetMissingFiles() const; boost::filesystem::path GetPath(const std::string &fileName) const { if (!IsConfigured(fileName, required_input_files) && diff --git a/src/osrm/osrm.cpp b/src/osrm/osrm.cpp index 06abf7b79e8..c6d6678f306 100644 --- a/src/osrm/osrm.cpp +++ b/src/osrm/osrm.cpp @@ -10,6 +10,8 @@ #include "engine/engine_config.hpp" #include "engine/status.hpp" +#include + #include namespace osrm @@ -25,8 +27,11 @@ OSRM::OSRM(engine::EngineConfig &config) // First, check that necessary core data is available if (!config.use_shared_memory && !config.storage_config.IsValid()) { - throw util::exception("Required files are missing, cannot continue. Have all the " - "pre-processing steps been run?"); + const auto &missingFiles = config.storage_config.GetMissingFiles(); + throw util::exception("Required files are missing, cannot continue. Have all the " + "pre-processing steps been run? " + "Missing files: " + + boost::algorithm::join(missingFiles, ", ")); } // Now, check that the algorithm requested can be used with the data diff --git a/src/storage/io_config.cpp b/src/storage/io_config.cpp index 82d8a914e30..560d5ac77ca 100644 --- a/src/storage/io_config.cpp +++ b/src/storage/io_config.cpp @@ -24,5 +24,18 @@ bool IOConfig::IsValid() const } return success; } + +std::vector IOConfig::GetMissingFiles() const +{ + std::vector missingFiles; + for (auto &fileName : required_input_files) + { + if (!boost::filesystem::is_regular_file({base_path.string() + fileName.string()})) + { + missingFiles.push_back(base_path.string() + fileName.string()); + } + } + return missingFiles; +} } }