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 /zenserver/experimental/usnjournal.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 'zenserver/experimental/usnjournal.cpp')
| -rw-r--r-- | zenserver/experimental/usnjournal.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/zenserver/experimental/usnjournal.cpp b/zenserver/experimental/usnjournal.cpp index f44e50945..a266c2338 100644 --- a/zenserver/experimental/usnjournal.cpp +++ b/zenserver/experimental/usnjournal.cpp @@ -164,7 +164,10 @@ UsnJournalReader::Initialize(std::filesystem::path VolumePath) HRESULT hRes = VolumeRootDir.Create(VolumePathName, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS); - ThrowIfFailed(hRes, "Failed to open handle to volume root"); + if (FAILED(hRes)) + { + ThrowSystemException(hRes, "Failed to open handle to volume root"); + } FILE_ID_INFO FileInformation{}; BOOL Success = GetFileInformationByHandleEx(VolumeRootDir, FileIdInfo, &FileInformation, sizeof FileInformation); |