diff options
Diffstat (limited to 'src/zencore/filesystem.cpp')
| -rw-r--r-- | src/zencore/filesystem.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/zencore/filesystem.cpp b/src/zencore/filesystem.cpp index a0ff3793e..36195f7c7 100644 --- a/src/zencore/filesystem.cpp +++ b/src/zencore/filesystem.cpp @@ -1287,12 +1287,12 @@ PathFromHandle(void* NativeHandle, std::error_code& Ec) { if (NativeHandle == nullptr) { - return std::filesystem::path(); + return "<error handle 'nullptr'>"; } #if ZEN_PLATFORM_WINDOWS if (NativeHandle == INVALID_HANDLE_VALUE) { - return std::filesystem::path(); + return "<error handle 'invalid handle'>"; } auto GetFinalPathNameByHandleWRetry = @@ -1329,7 +1329,7 @@ PathFromHandle(void* NativeHandle, std::error_code& Ec) if (Error != ERROR_SUCCESS) { Ec = MakeErrorCodeFromLastError(); - return std::filesystem::path(); + return fmt::format("<error handle '{}'>", Ec.message()); } if (RequiredLengthIncludingNul < PathDataSize) @@ -1346,7 +1346,7 @@ PathFromHandle(void* NativeHandle, std::error_code& Ec) if (Error != ERROR_SUCCESS) { Ec = MakeErrorCodeFromLastError(); - return std::filesystem::path(); + return fmt::format("<error handle '{}'>", Ec.message()); } ZEN_UNUSED(FinalLength); return FullPath; @@ -1360,7 +1360,7 @@ PathFromHandle(void* NativeHandle, std::error_code& Ec) if (BytesRead <= 0) { Ec = MakeErrorCodeFromLastError(); - return {}; + return fmt::format("<error handle '{}'>", Ec.message()); } Link[BytesRead] = '\0'; @@ -1371,7 +1371,7 @@ PathFromHandle(void* NativeHandle, std::error_code& Ec) if (fcntl(Fd, F_GETPATH, Path) < 0) { Ec = MakeErrorCodeFromLastError(); - return {}; + return fmt::format("<error handle '{}'>", Ec.message()); } return Path; |