From 7d13f307ff189c25a6e51f1782b3addd83859989 Mon Sep 17 00:00:00 2001 From: Siying Dong Date: Tue, 15 Jan 2019 16:41:50 -0800 Subject: [PATCH] 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 --- db/db_impl_open.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/db/db_impl_open.cc b/db/db_impl_open.cc index 2a3374156..51c9fb7ca 100644 --- a/db/db_impl_open.cc +++ b/db/db_impl_open.cc @@ -421,7 +421,10 @@ Status DBImpl::Recover( // produced by an older version of rocksdb. std::vector 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; }