diff options
| author | Dan Engelbrecht <[email protected]> | 2022-05-09 08:31:46 +0200 |
|---|---|---|
| committer | Dan Engelbrecht <[email protected]> | 2022-05-09 08:31:46 +0200 |
| commit | e177d1005c73512112b2ff6ab6f34e5d327c127b (patch) | |
| tree | b31ed4dc6d5b2f2920b32cec6ca18ed91e217616 /zenserver/cache/structuredcachestore.cpp | |
| parent | restore write using rename in PutStandaloneCacheValue (diff) | |
| download | zen-e177d1005c73512112b2ff6ab6f34e5d327c127b.tar.xz zen-e177d1005c73512112b2ff6ab6f34e5d327c127b.zip | |
fix exception message/logging
Diffstat (limited to 'zenserver/cache/structuredcachestore.cpp')
| -rw-r--r-- | zenserver/cache/structuredcachestore.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/zenserver/cache/structuredcachestore.cpp b/zenserver/cache/structuredcachestore.cpp index dee4c55f0..f69ffd82c 100644 --- a/zenserver/cache/structuredcachestore.cpp +++ b/zenserver/cache/structuredcachestore.cpp @@ -1735,15 +1735,16 @@ ZenCacheDiskLayer::CacheBucket::PutStandaloneCacheValue(const IoHash& HashKey, c DataFile.CreateTemporary(m_BucketDir.c_str(), Ec); if (Ec) { - throw std::system_error(Ec, fmt::format("Failed to open temporary file for put at '{}'", m_BucketDir)); + throw std::system_error(Ec, fmt::format("Failed to open temporary file for put in '{}'", m_BucketDir)); } DataFile.WriteAll(Value.Value, Ec); if (Ec) { throw std::system_error(Ec, - fmt::format("Failed to write payload ({} bytes) to temporary file for put in '{}'", + fmt::format("Failed to write payload ({} bytes) to temporary file '{}' for put in '{}'", NiceBytes(Value.Value.Size()), + DataFile.GetPath().string(), m_BucketDir)); } @@ -1775,6 +1776,7 @@ ZenCacheDiskLayer::CacheBucket::PutStandaloneCacheValue(const IoHash& HashKey, c { EntryFlags |= DiskLocation::kCompressed; } + DiskLocation Loc(Value.Value.Size(), EntryFlags); IndexEntry Entry = IndexEntry(Loc, GcClock::TickCount()); @@ -1810,7 +1812,8 @@ ZenCacheDiskLayer::CacheBucket::PutStandaloneCacheValue(const IoHash& HashKey, c fmt::format("Failed to create parent directory '{}' for file '{}' for put in '{}'", ParentPath, FsPath, m_BucketDir)); } - ZEN_INFO("Failed writing opening file '{}' for writing for put in '{}', pausing and retrying, reason '{}'", + ZEN_INFO("Failed renaming temporary file '{}' to '{}' for put in '{}', pausing and retrying, reason '{}'", + DataFile.GetPath().string(), FsPath.string(), m_BucketDir, Ec.message()); |