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:
committed by
Patrick Niklaus
parent
3d77714c36
commit
5026741652
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user