diff options
| author | Stefan Boberg <[email protected]> | 2021-05-21 21:17:12 +0200 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2021-05-21 21:17:12 +0200 |
| commit | 9f62b35a7380db253cce3310fa5208b8c8e20ef5 (patch) | |
| tree | ea6bdb2a876649c2eb5e1142d9c1a2a2d1c96ca8 /zencore/filesystem.cpp | |
| parent | Renamed CasBlobFile -> BasicFile (diff) | |
| download | zen-9f62b35a7380db253cce3310fa5208b8c8e20ef5.tar.xz zen-9f62b35a7380db253cce3310fa5208b8c8e20ef5.zip | |
Cleaned up exception handling
We now use std::system_error where possible to report Win32 system errors. We still have WindowsException for general HRESULT based errors but we should phase it out where possible
Diffstat (limited to 'zencore/filesystem.cpp')
| -rw-r--r-- | zencore/filesystem.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/zencore/filesystem.cpp b/zencore/filesystem.cpp index 578b28277..cb806b276 100644 --- a/zencore/filesystem.cpp +++ b/zencore/filesystem.cpp @@ -409,7 +409,7 @@ WriteFile(std::filesystem::path Path, const IoBuffer* const* Data, size_t Buffer HRESULT hRes = Outfile.Create(Path.c_str(), GENERIC_WRITE, FILE_SHARE_READ, CREATE_ALWAYS); if (FAILED(hRes)) { - zen::ThrowIfFailed(hRes, "File open failed for '{}'"_format(Path).c_str()); + zen::ThrowSystemException(hRes, "File open failed for '{}'"_format(Path).c_str()); } // TODO: this could be block-enlightened @@ -427,7 +427,7 @@ WriteFile(std::filesystem::path Path, const IoBuffer* const* Data, size_t Buffer if (FAILED(hRes)) { - zen::ThrowIfFailed(hRes, "File write failed for '{}'"_format(Path).c_str()); + zen::ThrowSystemException(hRes, "File write failed for '{}'"_format(Path).c_str()); } WriteSize -= ChunkSize; @@ -517,7 +517,7 @@ FileSystemTraversal::TraverseFileSystem(const std::filesystem::path& RootDir, Tr OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS); - zen::ThrowIfFailed(hRes, "Failed to open handle to volume root"); + zen::ThrowSystemException(hRes, "Failed to open handle to volume root"); while (Continue) { |