Make initialization fail with a specific exception if the dataset isn't compatible with the algorithm being used, rather than crashing when a query occurs.

This commit is contained in:
Daniel Patterson
2017-06-05 15:58:50 -07:00
committed by Patrick Niklaus
parent 3d77714c36
commit 5026741652
10 changed files with 138 additions and 47 deletions
+2 -10
View File
@@ -14,9 +14,9 @@ bool CheckFileList(const std::vector<boost::filesystem::path> &files)
bool success = true;
for (auto &path : files)
{
if (!boost::filesystem::is_regular_file(path))
if (!boost::filesystem::exists(path))
{
util::Log(logWARNING) << "Missing/Broken File: " << path.string();
util::Log(logERROR) << "Missing File: " << path.string();
success = false;
}
}
@@ -62,14 +62,6 @@ bool StorageConfig::IsValid() const
return false;
}
// TODO: add algorithm checks
// CH files
CheckFileList({hsgr_data_path, core_data_path});
// MLD files
CheckFileList({mld_partition_path, mld_storage_path, mld_graph_path});
return true;
}
}