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 e9b147be5..29ec14e0c 100644 --- a/src/zencore/filesystem.cpp +++ b/src/zencore/filesystem.cpp @@ -1288,12 +1288,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 = @@ -1330,7 +1330,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) @@ -1347,7 +1347,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; @@ -1361,7 +1361,7 @@ PathFromHandle(void* NativeHandle, std::error_code& Ec) if (BytesRead <= 0) { Ec = MakeErrorCodeFromLastError(); - return {}; + return fmt::format("<error handle '{}'>", Ec.message()); } Link[BytesRead] = '\0'; @@ -1372,7 +1372,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; |