diff options
author | Chris Wilson <chris+github@qwirx.com> | 2015-04-06 19:41:22 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2015-04-06 19:41:22 +0000 |
commit | 3cf9311eba9e6b8374b877eea385031936d187ba (patch) | |
tree | 72b4a602099c2093be35bfb40366fa052fbe3ea6 /lib/backupstore | |
parent | aeba7f1751b853d0ff85bf77abfc3d2179640d85 (diff) |
Improve error logging in win32 emu library.
Consistently capture the last Windows error code in the global variable
winerrno. Add logging macros that report the Windows error message for
this error code.
Diffstat (limited to 'lib/backupstore')
-rw-r--r-- | lib/backupstore/BackupStoreRefCountDatabase.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/backupstore/BackupStoreRefCountDatabase.cpp b/lib/backupstore/BackupStoreRefCountDatabase.cpp index e561f52b..8929b691 100644 --- a/lib/backupstore/BackupStoreRefCountDatabase.cpp +++ b/lib/backupstore/BackupStoreRefCountDatabase.cpp @@ -70,14 +70,15 @@ void BackupStoreRefCountDatabase::Commit() #ifdef WIN32 if(FileExists(Final_Filename) && unlink(Final_Filename.c_str()) != 0) { - THROW_SYS_FILE_ERROR("Failed to delete old permanent refcount " - "database file", mFilename, CommonException, OSFileError); + THROW_EMU_FILE_ERROR("Failed to delete old permanent refcount " + "database file", mFilename, CommonException, + OSFileError); } #endif if(rename(mFilename.c_str(), Final_Filename.c_str()) != 0) { - THROW_SYS_ERROR("Failed to rename temporary refcount database " + THROW_EMU_ERROR("Failed to rename temporary refcount database " "file from " << mFilename << " to " << Final_Filename, CommonException, OSFileError); } @@ -106,8 +107,9 @@ void BackupStoreRefCountDatabase::Discard() if(unlink(mFilename.c_str()) != 0) { - THROW_SYS_FILE_ERROR("Failed to delete temporary refcount database " - "file ", mFilename, CommonException, OSFileError); + THROW_EMU_FILE_ERROR("Failed to delete temporary refcount " + "database file", mFilename, CommonException, + OSFileError); } mIsModified = false; |