Improve Error Message When wal_dir doesn't exist (#4874)

Summary:
Right now the error mesage when options.wal_dir doesn't exist is not helpful to users. Be more specific
Pull Request resolved: https://github.com/facebook/rocksdb/pull/4874

Differential Revision: D13642425

Pulled By: siying

fbshipit-source-id: 9a3172ed0f799af233b0f3b2e5e35bc7ce04c7b5
This commit is contained in:
Siying Dong 2019-01-15 16:41:50 -08:00 committed by Facebook Github Bot
parent 55e03b67df
commit 7d13f307ff

View File

@ -421,7 +421,10 @@ Status DBImpl::Recover(
// produced by an older version of rocksdb.
std::vector<std::string> filenames;
s = env_->GetChildren(immutable_db_options_.wal_dir, &filenames);
if (!s.ok()) {
if (s.IsNotFound()) {
return Status::InvalidArgument("wal_dir not found",
immutable_db_options_.wal_dir);
} else if (!s.ok()) {
return s;
}