From f97567835dce6a7e31420f142f8aab8d48ecce8c Mon Sep 17 00:00:00 2001 From: sunby Date: Mon, 23 Dec 2024 17:37:55 +0800 Subject: [PATCH] add debug info Signed-off-by: sunby --- internal/core/src/storage/LocalChunkManager.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/internal/core/src/storage/LocalChunkManager.cpp b/internal/core/src/storage/LocalChunkManager.cpp index f300989ef9f6e..03f77ae784dce 100644 --- a/internal/core/src/storage/LocalChunkManager.cpp +++ b/internal/core/src/storage/LocalChunkManager.cpp @@ -15,6 +15,8 @@ // limitations under the License. #include "LocalChunkManager.h" +#include "boost/algorithm/string/join.hpp" +#include "boost/filesystem/directory.hpp" #include "log/Log.h" #include @@ -217,10 +219,18 @@ LocalChunkManager::RemoveDir(const std::string& dir) { boost::system::error_code err; boost::filesystem::remove_all(dirPath, err); if (err) { + boost::filesystem::directory_iterator it(dirPath); + std::vector paths; + for (; it != boost::filesystem::directory_iterator(); ++it) { + paths.push_back(it->path().string()); + } + std::string files = boost::algorithm::join(paths, ", "); PanicInfo(FileWriteFailed, - fmt::format("remove local directory:{} failed, error: {}", - dir, - err.message())); + fmt::format( + "remove local directory:{} failed, error: {}, files: {}", + dir, + err.message(), + files)); } }