From ea9d912a166b8edc52fc386978405a92630dfd1f Mon Sep 17 00:00:00 2001 From: Sebastian Messmer Date: Fri, 30 Oct 2015 18:10:24 +0100 Subject: [PATCH] Better exception in OnDiskBlockStore when rootdir is not a directory --- implementations/ondisk/OnDiskBlockStore.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/implementations/ondisk/OnDiskBlockStore.cpp b/implementations/ondisk/OnDiskBlockStore.cpp index a6b75231..9ef83446 100644 --- a/implementations/ondisk/OnDiskBlockStore.cpp +++ b/implementations/ondisk/OnDiskBlockStore.cpp @@ -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 }