aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2024-04-26 12:48:29 +0200
committerDan Engelbrecht <[email protected]>2024-04-26 12:48:29 +0200
commitf3affd5954ecde72c046150ac737f2b1416cbc3a (patch)
tree27f5ae8bca59a6c5207ee8cbbf15ee50eabb74a2
parentadd generic read file streaming in http client (diff)
downloadzen-de/httpclient-send-refactor.tar.xz
zen-de/httpclient-send-refactor.zip
error fix in ReadFileRangede/httpclient-send-refactor
-rw-r--r--src/zencore/filesystem.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/zencore/filesystem.cpp b/src/zencore/filesystem.cpp
index 6fdea31e1..dda1abb06 100644
--- a/src/zencore/filesystem.cpp
+++ b/src/zencore/filesystem.cpp
@@ -1062,12 +1062,13 @@ ReadFileRange(void* NativeHandle, uint64_t Offset, uint64_t Size, void* OutData)
if (Error)
{
std::error_code DummyEc;
- ZEN_WARN("ReadFile/pread failed (offset {:#x}, size {:#x}) file: '{}' (size {:#x})",
+ ZEN_WARN("ReadFile/pread failed with {} (offset {:#x}, size {:#x}) file: '{}' (size {:#x})",
+ Error,
Offset,
Size,
PathFromHandle(NativeHandle, DummyEc),
FileSizeFromHandle(NativeHandle));
- throw std::system_error(std::error_code(::GetLastError(), std::system_category()),
+ throw std::system_error(std::error_code(Error, std::system_category()),
fmt::format("ReadFile failed (offset {:#x}, size {:#x}) file: '{}' (size {:#x})",
Offset,
Size,