Better exception in OnDiskBlockStore when rootdir is not a directory

This commit is contained in:
Sebastian Messmer 2015-10-30 18:10:24 +01:00
parent 7402af10c4
commit ea9d912a16

View File

@ -17,6 +17,9 @@ OnDiskBlockStore::OnDiskBlockStore(const boost::filesystem::path &rootdir)
if (!bf::exists(rootdir)) {
throw std::runtime_error("Base directory not found");
}
if (!bf::is_directory(rootdir)) {
throw std::runtime_error("Base directory is not a directory");
}
//TODO Test for read access, write access, enter (x) access, and throw runtime_error in case
}