From 3b95585ecc08e26eded7fea4d61d4b092f5fbd2d Mon Sep 17 00:00:00 2001 From: Stefan Boberg Date: Tue, 11 May 2021 18:36:30 +0200 Subject: Added paths as context to I/O error exception messages --- zenserver/cache/cachestore.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'zenserver/cache/cachestore.cpp') diff --git a/zenserver/cache/cachestore.cpp b/zenserver/cache/cachestore.cpp index fc218de6b..5b0358994 100644 --- a/zenserver/cache/cachestore.cpp +++ b/zenserver/cache/cachestore.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -18,6 +19,7 @@ #include using namespace zen; +using namespace fmt::literals; namespace UE { @@ -720,7 +722,9 @@ ZenFile::Read(void* Data, uint64_t Size, uint64_t Offset) if (FAILED(hRes)) { - throw std::system_error(GetLastError(), std::system_category(), "Failed to read from file" /* TODO: add context */); + throw std::system_error(GetLastError(), + std::system_category(), + "Failed to read from file '{}'"_format(zen::PathFromHandle(m_File))); } } @@ -736,7 +740,7 @@ ZenFile::Write(const void* Data, uint64_t Size, uint64_t Offset) if (FAILED(hRes)) { - throw std::system_error(GetLastError(), std::system_category(), "Failed to write to file" /* TODO: add context */); + throw std::system_error(GetLastError(), std::system_category(), "Failed to write to file '{}'"_format(zen::PathFromHandle(m_File))); } } -- cgit v1.2.3