// Use of this source code is governed by an apache-2.0 license that can be
// found in the LICENSE file.
+#include <boost/filesystem/exception.hpp>
#include <boost/filesystem/operations.hpp>
#include <boost/filesystem/path.hpp>
#include <boost/system/error_code.hpp>
for (bf::directory_iterator iter(recovery_dir);
iter != bf::directory_iterator();
++iter) {
- bs::error_code error;
- if (bf::is_directory(iter->path(), error))
+ try {
+ if (bf::is_directory(iter->path()))
+ continue;
+ } catch (const bf::filesystem_error& e) {
+ LOG(ERROR) << "Failed to get is_directory result: " << e.what();
continue;
+ }
std::string file = iter->path().filename().string();
std::regex recovery_regex(kRecoveryFilePattern);
std::smatch match;