aboutsummaryrefslogtreecommitdiff
path: root/zencore/filesystem.cpp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2021-05-21 21:17:12 +0200
committerStefan Boberg <[email protected]>2021-05-21 21:17:12 +0200
commit9f62b35a7380db253cce3310fa5208b8c8e20ef5 (patch)
treeea6bdb2a876649c2eb5e1142d9c1a2a2d1c96ca8 /zencore/filesystem.cpp
parentRenamed CasBlobFile -> BasicFile (diff)
downloadzen-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.cpp6
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)
{