Skip to content

Commit

Permalink
create_snapshot-sortdb_wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
ban-nobuhiro committed Oct 20, 2023
1 parent 39fdf93 commit 28f1113
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/limestone/sortdb_wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class sortdb_wrapper {
}
if (Status status = DB::Open(options, workdir_path_.string(), &sortdb_); !status.ok()) {
LOG_LP(ERROR) << "Unable to open/create database working files, status = " << status.ToString();
std::abort();
throw std::runtime_error("I/O error");
}
}

Expand Down Expand Up @@ -118,13 +118,13 @@ class sortdb_wrapper {

boost::filesystem::path workdir_path_;

void clear_directory() const noexcept {
void clear_directory() const {
if (boost::filesystem::exists(workdir_path_)) {
if (boost::filesystem::is_directory(workdir_path_)) {
boost::filesystem::remove_all(workdir_path_);
} else {
LOG_LP(ERROR) << workdir_path_.string() << " is not a directory";
std::abort();
throw std::runtime_error("I/O error");
}
}
}
Expand Down

0 comments on commit 28f1113

Please sign in to comment.