Skip to content

Commit

Permalink
add debug info
Browse files Browse the repository at this point in the history
Signed-off-by: sunby <[email protected]>
  • Loading branch information
sunby committed Dec 26, 2024
1 parent 0cbb481 commit bc8fc34
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions internal/core/src/storage/LocalChunkManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <boost/filesystem.hpp>
Expand Down Expand Up @@ -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<std::string> paths;
for (; it != boost::filesystem::directory_iterator(); ++it) {
paths.push_back(it->path().string());

Check warning on line 225 in internal/core/src/storage/LocalChunkManager.cpp

View check run for this annotation

Codecov / codecov/patch

internal/core/src/storage/LocalChunkManager.cpp#L222-L225

Added lines #L222 - L225 were not covered by tests
}
std::string files = boost::algorithm::join(paths, ", ");

Check warning on line 227 in internal/core/src/storage/LocalChunkManager.cpp

View check run for this annotation

Codecov / codecov/patch

internal/core/src/storage/LocalChunkManager.cpp#L227

Added line #L227 was not covered by tests
PanicInfo(FileWriteFailed,
fmt::format("remove local directory:{} failed, error: {}",
dir,
err.message()));
fmt::format(
"remove local directory:{} failed, error: {}, files: {}",
dir,
err.message(),
files));
}
}

Expand Down

0 comments on commit bc8fc34

Please sign in to comment.